diff --git a/io/README.md b/io/README.md index df1c741b..1071fedf 100644 --- a/io/README.md +++ b/io/README.md @@ -3,13 +3,13 @@ ## Run the unit tests from the Command-Line ```shell -io tests/correctness/run.io +io ./tests/correctness/run.io ``` ## Run the TextTest Fixture from Command-Line ```shell -io tests/correctness/TexttestFixture.io +io ./tests/correctness/TexttestFixture.io ``` ### Specify Number of Days @@ -17,5 +17,5 @@ io tests/correctness/TexttestFixture.io For e.g. 10 days: ```shell -io tests/correctness/TexttestFixture.io 10 +io ./tests/correctness/TexttestFixture.io 10 ``` diff --git a/io/tests/correctness/TexttestFixture.io b/io/tests/correctness/TexttestFixture.io new file mode 100644 index 00000000..ecc6f7bd --- /dev/null +++ b/io/tests/correctness/TexttestFixture.io @@ -0,0 +1,34 @@ +doRelativeFile("../../io/Item.io") +doRelativeFile("../../io/GildedRose.io") + +writeln("OMGHAI!") + +items := list( + Item with("+5 Dexterity Vest", 10, 20), // + Item with("Aged Brie", 2, 0), // + Item with("Elixir of the Mongoose", 5, 7), // + Item with("Sulfuras, Hand of Ragnaros", 0, 80), // + Item with("Sulfuras, Hand of Ragnaros", -1, 80), + Item with("Backstage passes to a TAFKAL80ETC concert", 15, 20), + Item with("Backstage passes to a TAFKAL80ETC concert", 10, 49), + Item with("Backstage passes to a TAFKAL80ETC concert", 5, 49), + // this conjured item does not work properly yet + Item with("Conjured Mana Cake", 3, 6) +) + +app := GildedRose with(items) + +days := 2 +if (System args size > 1, + days = System args at(1) asNumber + 1 +) + +for(i, 0, days - 1, + writeln("-------- day " .. i .. " --------") + writeln("name, sellIn, quality") + items foreach(item, + writeln(item) + ) + writeln + app updateQuality +)