Port TextTestFixture.

This commit is contained in:
Peter Kofler 2024-12-13 01:46:44 +01:00
parent a91a6ef695
commit 3b7cb71b77
2 changed files with 37 additions and 3 deletions

View File

@ -3,13 +3,13 @@
## Run the unit tests from the Command-Line ## Run the unit tests from the Command-Line
```shell ```shell
io tests/correctness/run.io io ./tests/correctness/run.io
``` ```
## Run the TextTest Fixture from Command-Line ## Run the TextTest Fixture from Command-Line
```shell ```shell
io tests/correctness/TexttestFixture.io io ./tests/correctness/TexttestFixture.io
``` ```
### Specify Number of Days ### Specify Number of Days
@ -17,5 +17,5 @@ io tests/correctness/TexttestFixture.io
For e.g. 10 days: For e.g. 10 days:
```shell ```shell
io tests/correctness/TexttestFixture.io 10 io ./tests/correctness/TexttestFixture.io 10
``` ```

View File

@ -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
)