From 2685188ec823a8a1763280909922db7fb6eb882a Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 13 Sep 2025 10:57:03 +0200 Subject: [PATCH 01/61] added .bsp to .gitignore --- scala/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index 5534fac1..d254d02c 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -6,6 +6,8 @@ # IntelliJ .idea *.iml +.bsp +.bloop # Eclipse .worksheet From eb8c92055f09bb1ff09369d88a13fb8f7c685bdc Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 14:32:59 +0200 Subject: [PATCH 02/61] * bumped sbt version to 1.10.10 * bumped scala version to 3.7.3 --- scala/build.sbt | 2 +- scala/project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/build.sbt b/scala/build.sbt index 51404b8c..ec24d0b0 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -1,4 +1,4 @@ -val scala3Version = "3.6.4" +val scala3Version = "3.7.3" lazy val root = project .in(file(".")) diff --git a/scala/project/build.properties b/scala/project/build.properties index e97b2722..5e6884d3 100644 --- a/scala/project/build.properties +++ b/scala/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.10 +sbt.version=1.11.6 From 179990c1b16cb11256267a1d27d82eca55193c6a Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 15:05:50 +0200 Subject: [PATCH 03/61] * converted Java TextestFixture to scala --- .../com/gildedrose/TexttestFixture.scala | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 scala/src/test/scala/com/gildedrose/TexttestFixture.scala diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala new file mode 100644 index 00000000..fcfe471b --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -0,0 +1,35 @@ +package com.gildedrose + +object TexttestFixture { + @main + def main(args: String*): Unit = { + println("OMGHAI!") + + val items = Array[Item]( + Item("+5 Dexterity Vest", 10, 20), // + Item("Aged Brie", 2, 0), // + Item("Elixir of the Mongoose", 5, 7), // + Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("Sulfuras, Hand of Ragnaros", -1, 80), + Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), + Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), + Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), // this conjured item does not work properly yet + Item("Conjured Mana Cake", 3, 6) + ) + + val app = new GildedRose(items) + var days = 2 + + if (args.nonEmpty) days = args(0).toInt + 1 + + for (i <- 0 until days) { + println("-------- day " + i + " --------") + println("name, sellIn, quality") + for (item <- items) { + println(s"${item.name}, ${item.sellIn}, ${item.quality}") + } + println() + app.updateQuality() + } + } +} From 7aae423d53345ddfaef7db22ce51f046f2678182 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 19:47:35 +0200 Subject: [PATCH 04/61] added .bloop and vscode directories for scala to .gitignore --- scala/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index d254d02c..a467c6d7 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -9,6 +9,14 @@ .bsp .bloop +#vscode +.vscode +.metals +.scala-build +project/metals.sbt + + + # Eclipse .worksheet .settings From 3083e909b61f6bae5716d458fd02f011c216b525 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Thu, 18 Sep 2025 22:00:26 +0200 Subject: [PATCH 05/61] cleaned up texttest_rig.py --- .../com/gildedrose/TexttestFixture.scala | 4 +- scala/texttest_rig.py | 14 +++++++ texttests/ThirtyDays/stdout.gr | 38 +++++++++++++++++++ texttests/config.gr | 26 ++++++++++--- 4 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 scala/texttest_rig.py diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index fcfe471b..4cd78092 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -1,8 +1,8 @@ package com.gildedrose object TexttestFixture { - @main - def main(args: String*): Unit = { + + def main(args: Array[String]): Unit = { println("OMGHAI!") val items = Array[Item]( diff --git a/scala/texttest_rig.py b/scala/texttest_rig.py new file mode 100644 index 00000000..5ed7cf01 --- /dev/null +++ b/scala/texttest_rig.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +""" +This script uses Gradle to execute the TexttestFixture. +It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo. +It is more convenient for TextTest to use since Gradle needs +several arguments in addition to the one the TextTest fixture needs. +""" +import os +import subprocess +import sys + +args = " ".join(sys.argv[1:]) +TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd()) +subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt run "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index a04e48ac..486bd1ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,3 +1,40 @@ +[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) +[info] loading global plugins from /Users/rco/.sbt/1.0/plugins +[info] loading settings for project scala-build-build from metals.sbt... +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project +[success] Generated .bloop/scala-build.json +[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[info] loading settings for project root from build.sbt... +[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) +[info] running com.gildedrose.Main +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -371,3 +408,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 diff --git a/texttests/config.gr b/texttests/config.gr index 8716d11d..bb170d75 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -2,7 +2,7 @@ full_name:Gilded Rose Refactoring Kata # set your preferred editor and diff tool. view_program:subl -diff_program:meld +diff_program:kdiff3 # Settings for the Python version #executable:${TEXTTEST_HOME}/python/texttest_fixture.py @@ -25,8 +25,8 @@ diff_program:meld #interpreter:python # Settings for the Java version using the classpath -#executable:com.gildedrose.TexttestFixture -#interpreter:java +# executable:com.gildedrose.TexttestFixture +# interpreter:java # note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the Kotlin version using Gradle wrapped in a python script @@ -34,8 +34,8 @@ diff_program:meld #interpreter:python # Settings for the Ruby version -executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb -interpreter:ruby +#executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb +#interpreter:ruby # Settings for the C# Core version #executable:${TEXTTEST_HOME}/csharpcore/GildedRoseTests/bin/Debug/net8.0/GildedRoseTests @@ -70,4 +70,20 @@ interpreter:ruby # Settings for the Odin version #executable:${TEXTTEST_HOME}/odin/gilded_rose +# Settings for the scala version using the classpath +# executable:com.gildedrose.TexttestFixture +#executable:com.gildedrose.TexttestFixture.scala +#interpreter:"scala run" +# note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual + +# Settings for the scala version using sbt wrapped in a python script +executable:${TEXTTEST_HOME}/scala/texttest_rig.py +interpreter:python + + filename_convention_scheme:standard + +[run_dependent_text] +stdout:\[info\] +stdout:\[success\] +stdout:And lines like this From 5904431bde9d4dc46c76f931eda869a76e35be0f Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 21:14:05 +0200 Subject: [PATCH 06/61] removed extra, unnecessary run in texttest_rig.py --- scala/texttest_rig.py | 4 ++-- texttests/ThirtyDays/stdout.gr | 35 ++++++---------------------------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/scala/texttest_rig.py b/scala/texttest_rig.py index 5ed7cf01..23bd74f7 100644 --- a/scala/texttest_rig.py +++ b/scala/texttest_rig.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """ -This script uses Gradle to execute the TexttestFixture. +This script uses sbt to execute the TexttestFixture. It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo. It is more convenient for TextTest to use since Gradle needs several arguments in addition to the one the TextTest fixture needs. @@ -11,4 +11,4 @@ import sys args = " ".join(sys.argv[1:]) TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd()) -subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt run "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) +subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 486bd1ac..3edea854 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -4,36 +4,13 @@ [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project [success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[success] Total time: 1 s, completed 26.09.2025, 20:16:59 [info] loading settings for project root from build.sbt... [info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] running com.gildedrose.Main -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... +[info] done compiling +[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... +[info] done compiling [info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- @@ -408,4 +385,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[success] Total time: 2 s, completed 26.09.2025, 20:17:01 From ced0cf4c31bc8f959e48bce89f6d685185cd2c18 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 07/61] setup approval tests with golden master using scalatest --- scala/.gitignore | 1 + scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++ .../gildedrose/GildedRoseApprovalTest.scala | 32 ++ 3 files changed, 406 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt create mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala diff --git a/scala/.gitignore b/scala/.gitignore index a467c6d7..f6e0eff3 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -27,3 +27,4 @@ project/metals.sbt .classpath target/ +approvaltests/gildedrose.testresult.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala new file mode 100644 index 00000000..32224404 --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala @@ -0,0 +1,32 @@ +package com.gildedrose + +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers + +import java.io.{File, FileOutputStream} +import scala.io.Source + +class GildedRoseApprovalTest extends AnyFlatSpec with Matchers { + it should "return the result of the golden master" in { + val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") + val outputStream = new FileOutputStream(fileWithTestResult) + Console.withOut(outputStream) { + + TexttestFixture.main(Array("30")) + } + + val approvedFile = "approvaltests/gildedrose.approved.txt" + val sourceForTestResults = Source.fromFile(fileWithTestResult) + val sourceForApprovedFile = Source.fromFile(approvedFile) + + val resultingOutput = + try sourceForTestResults.getLines().toVector + finally sourceForTestResults.close() + val approvedOutput = + try sourceForApprovedFile.getLines().toVector + finally sourceForTestResults.close() + + resultingOutput should equal(approvedOutput) + } + +} From db3b9ef3da9c9185b655cccacacc3f255a97da9c Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 10:49:02 +0200 Subject: [PATCH 08/61] removed unnecessary comment markers at line ends in TexttestFixture.scala --- scala/src/test/scala/com/gildedrose/TexttestFixture.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index 4cd78092..e8da3d53 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -6,10 +6,10 @@ object TexttestFixture { println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), // - Item("Aged Brie", 2, 0), // - Item("Elixir of the Mongoose", 5, 7), // - Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("+5 Dexterity Vest", 10, 20), + Item("Aged Brie", 2, 0), + Item("Elixir of the Mongoose", 5, 7), + Item("Sulfuras, Hand of Ragnaros", 0, 80), Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), From 84c024e13d530bbf903dc41642922f4496fba345 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:45:13 +0200 Subject: [PATCH 09/61] clean-up of texttest/config.gr --- texttests/config.gr | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/texttests/config.gr b/texttests/config.gr index bb170d75..08b7fcb7 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -70,20 +70,15 @@ diff_program:kdiff3 # Settings for the Odin version #executable:${TEXTTEST_HOME}/odin/gilded_rose -# Settings for the scala version using the classpath -# executable:com.gildedrose.TexttestFixture -#executable:com.gildedrose.TexttestFixture.scala -#interpreter:"scala run" -# note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the scala version using sbt wrapped in a python script -executable:${TEXTTEST_HOME}/scala/texttest_rig.py -interpreter:python +# executable:${TEXTTEST_HOME}/scala/texttest_rig.py +# interpreter:python filename_convention_scheme:standard -[run_dependent_text] -stdout:\[info\] -stdout:\[success\] -stdout:And lines like this +# uncomment for the scala version using sbt wrapped into python +#[run_dependent_text] +#stdout:\[info\] +#stdout:\[success\] From 1035cfdc300ef39f40a237164f96a9f178e78e44 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:45:32 +0200 Subject: [PATCH 10/61] updated README.md for scala --- scala/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scala/README.md b/scala/README.md index d8f35317..23ec0213 100644 --- a/scala/README.md +++ b/scala/README.md @@ -20,3 +20,26 @@ sbt "run 10" ``` cmd sbt test ``` + +## Run approval tests + +The approval test creates a file with an result of the test fixture in approvaltests/gildedrose.testresult.txt. The very first test run will fail and the resulting gildedrose.testresult.txt can be moved/renamed to gildedrose.approved.txt. + +The approval tests in the test directory under GildedRoseApprovalTest.scala will regenerate the test result on each run and compare it to the approved file. The approval test will fail when thee are any differences between the files. + +To approve a new version simply rename the resulting test output to gildedrose.approved.txt + +Approval tests are part of the test suite triggered by sbt. + +``` cmd +sbt test +``` + +## Run texttest version of approval tests + +To run the texttest version, first edit the texttest configuration file. It contains to sections for scala that need to be uncommented. + +* the executable and interpreter lines to run texttest_rig.py to trigger an sbt run +* the four lines in the run_dependent_text section to ignore sbt's info and success lines in the output. + +Be aware that running the texttest version is somewhat slow since starting sbt takes some time. \ No newline at end of file From f21abadd44bb71fa18c6268711394fa7c991f3cd Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:46:48 +0200 Subject: [PATCH 11/61] added approvaltests/gildedrose.approved.txt.bak as template for approval file --- .../{gildedrose.approved.txt => gildedrose.approved.txt.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scala/approvaltests/{gildedrose.approved.txt => gildedrose.approved.txt.bak} (100%) diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt.bak similarity index 100% rename from scala/approvaltests/gildedrose.approved.txt rename to scala/approvaltests/gildedrose.approved.txt.bak From 2e4a1d155303fa1604e20b60befcf11f341c4701 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 07:52:12 +0200 Subject: [PATCH 12/61] removed obsolete .gitignore in projects directory --- scala/project/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 scala/project/.gitignore diff --git a/scala/project/.gitignore b/scala/project/.gitignore deleted file mode 100644 index 6ba19f7f..00000000 --- a/scala/project/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -project/ -target/ From dab7625ea02084c5d6609dbdb4a4e80027f0a6f0 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 20:47:25 +0200 Subject: [PATCH 13/61] added template with the result of the first run of the approval tests --- scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + From d61900953d51d99c77058f089af58356817503e3 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 20:56:05 +0200 Subject: [PATCH 14/61] cleaned up config.gr --- texttests/config.gr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttests/config.gr b/texttests/config.gr index 08b7fcb7..60ffe0da 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -2,7 +2,7 @@ full_name:Gilded Rose Refactoring Kata # set your preferred editor and diff tool. view_program:subl -diff_program:kdiff3 +diff_program:meld # Settings for the Python version #executable:${TEXTTEST_HOME}/python/texttest_fixture.py From e102f17c4bef97cd24888da573b6c42b8330f37d Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 21:01:15 +0200 Subject: [PATCH 15/61] cleaned up stdout.gr --- texttests/ThirtyDays/stdout.gr | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 3edea854..a04e48ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,17 +1,3 @@ -[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) -[info] loading global plugins from /Users/rco/.sbt/1.0/plugins -[info] loading settings for project scala-build-build from metals.sbt... -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project -[success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:16:59 -[info] loading settings for project root from build.sbt... -[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... -[info] done compiling -[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... -[info] done compiling -[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -385,4 +371,3 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 2 s, completed 26.09.2025, 20:17:01 From 618e6df491a3cc6b303b747f5d539770310c543f Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 13 Sep 2025 10:57:03 +0200 Subject: [PATCH 16/61] added .bsp to .gitignore --- scala/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index 5534fac1..d254d02c 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -6,6 +6,8 @@ # IntelliJ .idea *.iml +.bsp +.bloop # Eclipse .worksheet From 5b88a3d78b5288fa9fd19adc99ebc64a19421167 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 14:32:59 +0200 Subject: [PATCH 17/61] * bumped sbt version to 1.10.10 * bumped scala version to 3.7.3 --- scala/build.sbt | 2 +- scala/project/build.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/scala/build.sbt b/scala/build.sbt index 51404b8c..ec24d0b0 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -1,4 +1,4 @@ -val scala3Version = "3.6.4" +val scala3Version = "3.7.3" lazy val root = project .in(file(".")) diff --git a/scala/project/build.properties b/scala/project/build.properties index e97b2722..5e6884d3 100644 --- a/scala/project/build.properties +++ b/scala/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.10 +sbt.version=1.11.6 From c9919d1a1b0d7331223f07271e18e63552f1da41 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 15:05:50 +0200 Subject: [PATCH 18/61] * converted Java TextestFixture to scala --- .../com/gildedrose/TexttestFixture.scala | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 scala/src/test/scala/com/gildedrose/TexttestFixture.scala diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala new file mode 100644 index 00000000..fcfe471b --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -0,0 +1,35 @@ +package com.gildedrose + +object TexttestFixture { + @main + def main(args: String*): Unit = { + println("OMGHAI!") + + val items = Array[Item]( + Item("+5 Dexterity Vest", 10, 20), // + Item("Aged Brie", 2, 0), // + Item("Elixir of the Mongoose", 5, 7), // + Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("Sulfuras, Hand of Ragnaros", -1, 80), + Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), + Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), + Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), // this conjured item does not work properly yet + Item("Conjured Mana Cake", 3, 6) + ) + + val app = new GildedRose(items) + var days = 2 + + if (args.nonEmpty) days = args(0).toInt + 1 + + for (i <- 0 until days) { + println("-------- day " + i + " --------") + println("name, sellIn, quality") + for (item <- items) { + println(s"${item.name}, ${item.sellIn}, ${item.quality}") + } + println() + app.updateQuality() + } + } +} From 4f621844baa97812fde952826420f3410aae21b7 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 19:47:35 +0200 Subject: [PATCH 19/61] added .bloop and vscode directories for scala to .gitignore --- scala/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index d254d02c..a467c6d7 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -9,6 +9,14 @@ .bsp .bloop +#vscode +.vscode +.metals +.scala-build +project/metals.sbt + + + # Eclipse .worksheet .settings From c3692a1e82ef56a9403c2584d938aa7d71395cd2 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Thu, 18 Sep 2025 22:00:26 +0200 Subject: [PATCH 20/61] cleaned up texttest_rig.py --- .../com/gildedrose/TexttestFixture.scala | 4 +- scala/texttest_rig.py | 14 +++++++ texttests/ThirtyDays/stdout.gr | 38 +++++++++++++++++++ texttests/config.gr | 26 ++++++++++--- 4 files changed, 75 insertions(+), 7 deletions(-) create mode 100644 scala/texttest_rig.py diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index fcfe471b..4cd78092 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -1,8 +1,8 @@ package com.gildedrose object TexttestFixture { - @main - def main(args: String*): Unit = { + + def main(args: Array[String]): Unit = { println("OMGHAI!") val items = Array[Item]( diff --git a/scala/texttest_rig.py b/scala/texttest_rig.py new file mode 100644 index 00000000..5ed7cf01 --- /dev/null +++ b/scala/texttest_rig.py @@ -0,0 +1,14 @@ +#!/usr/bin/env python +""" +This script uses Gradle to execute the TexttestFixture. +It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo. +It is more convenient for TextTest to use since Gradle needs +several arguments in addition to the one the TextTest fixture needs. +""" +import os +import subprocess +import sys + +args = " ".join(sys.argv[1:]) +TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd()) +subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt run "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index a04e48ac..486bd1ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,3 +1,40 @@ +[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) +[info] loading global plugins from /Users/rco/.sbt/1.0/plugins +[info] loading settings for project scala-build-build from metals.sbt... +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project +[success] Generated .bloop/scala-build.json +[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[info] loading settings for project root from build.sbt... +[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) +[info] running com.gildedrose.Main +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -371,3 +408,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 diff --git a/texttests/config.gr b/texttests/config.gr index 8716d11d..bb170d75 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -2,7 +2,7 @@ full_name:Gilded Rose Refactoring Kata # set your preferred editor and diff tool. view_program:subl -diff_program:meld +diff_program:kdiff3 # Settings for the Python version #executable:${TEXTTEST_HOME}/python/texttest_fixture.py @@ -25,8 +25,8 @@ diff_program:meld #interpreter:python # Settings for the Java version using the classpath -#executable:com.gildedrose.TexttestFixture -#interpreter:java +# executable:com.gildedrose.TexttestFixture +# interpreter:java # note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the Kotlin version using Gradle wrapped in a python script @@ -34,8 +34,8 @@ diff_program:meld #interpreter:python # Settings for the Ruby version -executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb -interpreter:ruby +#executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb +#interpreter:ruby # Settings for the C# Core version #executable:${TEXTTEST_HOME}/csharpcore/GildedRoseTests/bin/Debug/net8.0/GildedRoseTests @@ -70,4 +70,20 @@ interpreter:ruby # Settings for the Odin version #executable:${TEXTTEST_HOME}/odin/gilded_rose +# Settings for the scala version using the classpath +# executable:com.gildedrose.TexttestFixture +#executable:com.gildedrose.TexttestFixture.scala +#interpreter:"scala run" +# note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual + +# Settings for the scala version using sbt wrapped in a python script +executable:${TEXTTEST_HOME}/scala/texttest_rig.py +interpreter:python + + filename_convention_scheme:standard + +[run_dependent_text] +stdout:\[info\] +stdout:\[success\] +stdout:And lines like this From 86bcfd62a7d43b84649cc6bbca006a7221f39dc0 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 21:14:05 +0200 Subject: [PATCH 21/61] removed extra, unnecessary run in texttest_rig.py --- scala/texttest_rig.py | 4 ++-- texttests/ThirtyDays/stdout.gr | 35 ++++++---------------------------- 2 files changed, 8 insertions(+), 31 deletions(-) diff --git a/scala/texttest_rig.py b/scala/texttest_rig.py index 5ed7cf01..23bd74f7 100644 --- a/scala/texttest_rig.py +++ b/scala/texttest_rig.py @@ -1,6 +1,6 @@ #!/usr/bin/env python """ -This script uses Gradle to execute the TexttestFixture. +This script uses sbt to execute the TexttestFixture. It is designed to be used by TextTest and specified in the file 'texttests/config.gr' in this repo. It is more convenient for TextTest to use since Gradle needs several arguments in addition to the one the TextTest fixture needs. @@ -11,4 +11,4 @@ import sys args = " ".join(sys.argv[1:]) TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd()) -subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt run "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) +subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 486bd1ac..3edea854 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -4,36 +4,13 @@ [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project [success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[success] Total time: 1 s, completed 26.09.2025, 20:16:59 [info] loading settings for project root from build.sbt... [info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] running com.gildedrose.Main -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... +[info] done compiling +[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... +[info] done compiling [info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- @@ -408,4 +385,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[success] Total time: 2 s, completed 26.09.2025, 20:17:01 From f392c528dce1378ee33ee04115ae07cbe08d927f Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 22/61] setup approval tests with golden master using scalatest --- scala/.gitignore | 1 + scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++ .../gildedrose/GildedRoseApprovalTest.scala | 32 ++ 3 files changed, 406 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt create mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala diff --git a/scala/.gitignore b/scala/.gitignore index a467c6d7..f6e0eff3 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -27,3 +27,4 @@ project/metals.sbt .classpath target/ +approvaltests/gildedrose.testresult.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala new file mode 100644 index 00000000..32224404 --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala @@ -0,0 +1,32 @@ +package com.gildedrose + +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers + +import java.io.{File, FileOutputStream} +import scala.io.Source + +class GildedRoseApprovalTest extends AnyFlatSpec with Matchers { + it should "return the result of the golden master" in { + val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") + val outputStream = new FileOutputStream(fileWithTestResult) + Console.withOut(outputStream) { + + TexttestFixture.main(Array("30")) + } + + val approvedFile = "approvaltests/gildedrose.approved.txt" + val sourceForTestResults = Source.fromFile(fileWithTestResult) + val sourceForApprovedFile = Source.fromFile(approvedFile) + + val resultingOutput = + try sourceForTestResults.getLines().toVector + finally sourceForTestResults.close() + val approvedOutput = + try sourceForApprovedFile.getLines().toVector + finally sourceForTestResults.close() + + resultingOutput should equal(approvedOutput) + } + +} From acfb870700472d102d99231a54112fcba3ea25f5 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 10:49:02 +0200 Subject: [PATCH 23/61] removed unnecessary comment markers at line ends in TexttestFixture.scala --- scala/src/test/scala/com/gildedrose/TexttestFixture.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index 4cd78092..e8da3d53 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -6,10 +6,10 @@ object TexttestFixture { println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), // - Item("Aged Brie", 2, 0), // - Item("Elixir of the Mongoose", 5, 7), // - Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("+5 Dexterity Vest", 10, 20), + Item("Aged Brie", 2, 0), + Item("Elixir of the Mongoose", 5, 7), + Item("Sulfuras, Hand of Ragnaros", 0, 80), Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), From a4b2b94a63501766de3ffee3c40ffb80e086d986 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:45:13 +0200 Subject: [PATCH 24/61] clean-up of texttest/config.gr --- texttests/config.gr | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/texttests/config.gr b/texttests/config.gr index bb170d75..08b7fcb7 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -70,20 +70,15 @@ diff_program:kdiff3 # Settings for the Odin version #executable:${TEXTTEST_HOME}/odin/gilded_rose -# Settings for the scala version using the classpath -# executable:com.gildedrose.TexttestFixture -#executable:com.gildedrose.TexttestFixture.scala -#interpreter:"scala run" -# note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the scala version using sbt wrapped in a python script -executable:${TEXTTEST_HOME}/scala/texttest_rig.py -interpreter:python +# executable:${TEXTTEST_HOME}/scala/texttest_rig.py +# interpreter:python filename_convention_scheme:standard -[run_dependent_text] -stdout:\[info\] -stdout:\[success\] -stdout:And lines like this +# uncomment for the scala version using sbt wrapped into python +#[run_dependent_text] +#stdout:\[info\] +#stdout:\[success\] From fd027c41876bb0cb8120a05053a8a36ab84c719e Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:45:32 +0200 Subject: [PATCH 25/61] updated README.md for scala --- scala/README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/scala/README.md b/scala/README.md index d8f35317..23ec0213 100644 --- a/scala/README.md +++ b/scala/README.md @@ -20,3 +20,26 @@ sbt "run 10" ``` cmd sbt test ``` + +## Run approval tests + +The approval test creates a file with an result of the test fixture in approvaltests/gildedrose.testresult.txt. The very first test run will fail and the resulting gildedrose.testresult.txt can be moved/renamed to gildedrose.approved.txt. + +The approval tests in the test directory under GildedRoseApprovalTest.scala will regenerate the test result on each run and compare it to the approved file. The approval test will fail when thee are any differences between the files. + +To approve a new version simply rename the resulting test output to gildedrose.approved.txt + +Approval tests are part of the test suite triggered by sbt. + +``` cmd +sbt test +``` + +## Run texttest version of approval tests + +To run the texttest version, first edit the texttest configuration file. It contains to sections for scala that need to be uncommented. + +* the executable and interpreter lines to run texttest_rig.py to trigger an sbt run +* the four lines in the run_dependent_text section to ignore sbt's info and success lines in the output. + +Be aware that running the texttest version is somewhat slow since starting sbt takes some time. \ No newline at end of file From cd89faa9c026eee4235970396c943f43f895c410 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 14:46:48 +0200 Subject: [PATCH 26/61] added approvaltests/gildedrose.approved.txt.bak as template for approval file --- .../{gildedrose.approved.txt => gildedrose.approved.txt.bak} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename scala/approvaltests/{gildedrose.approved.txt => gildedrose.approved.txt.bak} (100%) diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt.bak similarity index 100% rename from scala/approvaltests/gildedrose.approved.txt rename to scala/approvaltests/gildedrose.approved.txt.bak From 511d34b48e3ebb983320b4169cc2ad7dd5b71117 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 07:52:12 +0200 Subject: [PATCH 27/61] removed obsolete .gitignore in projects directory --- scala/project/.gitignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 scala/project/.gitignore diff --git a/scala/project/.gitignore b/scala/project/.gitignore deleted file mode 100644 index 6ba19f7f..00000000 --- a/scala/project/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -project/ -target/ From 217732ba8f7dd40d48d63b49ff7755471e125911 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 20:47:25 +0200 Subject: [PATCH 28/61] added template with the result of the first run of the approval tests --- scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + From 9ef3cf93f2202c65e47ed841ca70a459a52649f0 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 20:56:05 +0200 Subject: [PATCH 29/61] cleaned up config.gr --- texttests/config.gr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/texttests/config.gr b/texttests/config.gr index 08b7fcb7..60ffe0da 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -2,7 +2,7 @@ full_name:Gilded Rose Refactoring Kata # set your preferred editor and diff tool. view_program:subl -diff_program:kdiff3 +diff_program:meld # Settings for the Python version #executable:${TEXTTEST_HOME}/python/texttest_fixture.py From c27ad4786cda86cc15d93cc229fe96666d516969 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 29 Sep 2025 21:01:15 +0200 Subject: [PATCH 30/61] cleaned up stdout.gr --- texttests/ThirtyDays/stdout.gr | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 3edea854..a04e48ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,17 +1,3 @@ -[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) -[info] loading global plugins from /Users/rco/.sbt/1.0/plugins -[info] loading settings for project scala-build-build from metals.sbt... -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project -[success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:16:59 -[info] loading settings for project root from build.sbt... -[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... -[info] done compiling -[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... -[info] done compiling -[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -385,4 +371,3 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 2 s, completed 26.09.2025, 20:17:01 From 36acc45c3e3712e93775181c159bf0c0ef8c321f Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Wed, 1 Oct 2025 07:32:09 +0200 Subject: [PATCH 31/61] dependencies added to sbt to compile GildedRoseApprovalTest.java --- scala/build.sbt | 11 +++--- .../gildedrose/GildedRoseApprovalTest.java | 38 +++++++++++++++++++ ...la => GildedRoseApprovalTestInScala.scala} | 2 +- 3 files changed, 45 insertions(+), 6 deletions(-) create mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java rename scala/src/test/scala/com/gildedrose/{GildedRoseApprovalTest.scala => GildedRoseApprovalTestInScala.scala} (93%) diff --git a/scala/build.sbt b/scala/build.sbt index ec24d0b0..fa956336 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -3,9 +3,10 @@ val scala3Version = "3.7.3" lazy val root = project .in(file(".")) .settings( - name := "GildedRose", - version := "1.0", - scalaVersion := scala3Version, - - libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % "test" + name := "GildedRose", + version := "1.0", + scalaVersion := scala3Version, + libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % "test", + libraryDependencies += "com.approvaltests" % "approvaltests" % "25.4.3" % "test", + libraryDependencies += "org.junit.jupiter" % "junit-jupiter" % "5.11.4" % "test" ) diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java new file mode 100644 index 00000000..6bd7365a --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java @@ -0,0 +1,38 @@ +package com.gildedrose; + +import org.approvaltests.Approvals; +import org.approvaltests.reporters.DiffReporter; +import org.approvaltests.reporters.UseReporter; +import org.junit.jupiter.api.Test; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.PrintStream; + +@UseReporter(DiffReporter.class) +public class GildedRoseApprovalTest { + + @Test + public void foo() { + + Item[] items = new Item[]{new Item("foo", 0, 0)}; + GildedRose app = new GildedRose(items); + app.updateQuality(); + + Approvals.verifyAll("Items", items); + } + + @Test + public void thirtyDays() { + + ByteArrayOutputStream fakeoutput = new ByteArrayOutputStream(); + System.setOut(new PrintStream(fakeoutput)); + System.setIn(new ByteArrayInputStream("a\n".getBytes())); + + // todo: fix Program +// Program.main(); + String output = fakeoutput.toString(); + + Approvals.verify(output); + } +} \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala similarity index 93% rename from scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala rename to scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala index 32224404..d7e6c43c 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala @@ -6,7 +6,7 @@ import org.scalatest.matchers.should.Matchers import java.io.{File, FileOutputStream} import scala.io.Source -class GildedRoseApprovalTest extends AnyFlatSpec with Matchers { +class GildedRoseApprovalTestInScala extends AnyFlatSpec with Matchers { it should "return the result of the golden master" in { val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") val outputStream = new FileOutputStream(fileWithTestResult) From 9456bfce1f5908364e1757e1984dd06b569c0fbd Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Wed, 1 Oct 2025 08:31:06 +0200 Subject: [PATCH 32/61] all approval tests running with the java approval test framework --- scala/src/main/scala/com/gildedrose/Item.scala | 2 +- .../src/test/scala/com/gildedrose/GildedRoseApprovalTest.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/scala/src/main/scala/com/gildedrose/Item.scala b/scala/src/main/scala/com/gildedrose/Item.scala index 8515ced7..f30ab6e2 100644 --- a/scala/src/main/scala/com/gildedrose/Item.scala +++ b/scala/src/main/scala/com/gildedrose/Item.scala @@ -1,5 +1,5 @@ package com.gildedrose -class Item(val name: String, var sellIn: Int, var quality: Int) { +case class Item(val name: String, var sellIn: Int, var quality: Int) { } \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java index 6bd7365a..d71d1960 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java @@ -29,8 +29,8 @@ public class GildedRoseApprovalTest { System.setOut(new PrintStream(fakeoutput)); System.setIn(new ByteArrayInputStream("a\n".getBytes())); - // todo: fix Program -// Program.main(); + String[] args = {"30"}; + TexttestFixture.main(args); String output = fakeoutput.toString(); Approvals.verify(output); From 2e0e557c6eeaf44df61682c9d1933e00a4715358 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 4 Oct 2025 21:19:41 +0200 Subject: [PATCH 33/61] * ignored old approval test * added sbt-jupiter-interface --- scala/build.sbt | 19 +++++++++++++------ scala/project/plugins.sbt | 1 + .../GildedRoseApprovalTestInScala.scala | 3 ++- 3 files changed, 16 insertions(+), 7 deletions(-) create mode 100644 scala/project/plugins.sbt diff --git a/scala/build.sbt b/scala/build.sbt index fa956336..dddac539 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -3,10 +3,17 @@ val scala3Version = "3.7.3" lazy val root = project .in(file(".")) .settings( - name := "GildedRose", - version := "1.0", - scalaVersion := scala3Version, - libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.19" % "test", - libraryDependencies += "com.approvaltests" % "approvaltests" % "25.4.3" % "test", - libraryDependencies += "org.junit.jupiter" % "junit-jupiter" % "5.11.4" % "test" + name := "GildedRose", + version := "1.0", + scalaVersion := scala3Version, + libraryDependencies ++= Seq( + "org.scalatest" %% "scalatest" % "3.2.19" % Test, + "com.approvaltests" % "approvaltests" % "25.4.3" % Test, + "junit" % "junit" % "4.13.2", + "com.github.sbt.junit" % "jupiter-interface" % "0.15.1" % Test, + // todo: comment about 5.8.0 + "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % Test + ), + testOptions += Tests.Argument(TestFrameworks.JUnit) + ) diff --git a/scala/project/plugins.sbt b/scala/project/plugins.sbt new file mode 100644 index 00000000..82244db7 --- /dev/null +++ b/scala/project/plugins.sbt @@ -0,0 +1 @@ +addSbtPlugin("com.github.sbt.junit" % "sbt-jupiter-interface" % "0.15.1") diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala index d7e6c43c..b1755aea 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala @@ -6,8 +6,9 @@ import org.scalatest.matchers.should.Matchers import java.io.{File, FileOutputStream} import scala.io.Source + class GildedRoseApprovalTestInScala extends AnyFlatSpec with Matchers { - it should "return the result of the golden master" in { + ignore should "return the result of the golden master" in { val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") val outputStream = new FileOutputStream(fileWithTestResult) Console.withOut(outputStream) { From 2b3208784322682178c15acf2c50682408dcce98 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 5 Oct 2025 21:16:47 +0200 Subject: [PATCH 34/61] before cleanup without java tests --- scala/.gitignore | 2 + scala/build.sbt | 3 +- .../gildedrose/GildedRoseApprovalTest.java | 38 ------------- .../GildedRoseApprovalTestInScala.scala | 55 ++++++++++--------- .../com/gildedrose/TexttestFixture.scala | 10 ++-- 5 files changed, 38 insertions(+), 70 deletions(-) delete mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java diff --git a/scala/.gitignore b/scala/.gitignore index f6e0eff3..00610921 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -1,4 +1,6 @@ /bin/ +lib +project # OSX Finder .DS_Store diff --git a/scala/build.sbt b/scala/build.sbt index dddac539..c7ab2489 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -11,8 +11,7 @@ lazy val root = project "com.approvaltests" % "approvaltests" % "25.4.3" % Test, "junit" % "junit" % "4.13.2", "com.github.sbt.junit" % "jupiter-interface" % "0.15.1" % Test, - // todo: comment about 5.8.0 - "org.junit.jupiter" % "junit-jupiter" % "5.7.0" % Test + "org.junit.jupiter" % "junit-jupiter" % "6.0.0" % Test ), testOptions += Tests.Argument(TestFrameworks.JUnit) diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java deleted file mode 100644 index d71d1960..00000000 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.gildedrose; - -import org.approvaltests.Approvals; -import org.approvaltests.reporters.DiffReporter; -import org.approvaltests.reporters.UseReporter; -import org.junit.jupiter.api.Test; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.PrintStream; - -@UseReporter(DiffReporter.class) -public class GildedRoseApprovalTest { - - @Test - public void foo() { - - Item[] items = new Item[]{new Item("foo", 0, 0)}; - GildedRose app = new GildedRose(items); - app.updateQuality(); - - Approvals.verifyAll("Items", items); - } - - @Test - public void thirtyDays() { - - ByteArrayOutputStream fakeoutput = new ByteArrayOutputStream(); - System.setOut(new PrintStream(fakeoutput)); - System.setIn(new ByteArrayInputStream("a\n".getBytes())); - - String[] args = {"30"}; - TexttestFixture.main(args); - String output = fakeoutput.toString(); - - Approvals.verify(output); - } -} \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala index b1755aea..117d1656 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala @@ -1,33 +1,38 @@ -package com.gildedrose +package com.gildedrose; -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers +import org.approvaltests.Approvals +import org.approvaltests.reporters.DiffReporter +import org.approvaltests.reporters.UseReporter +import org.junit.jupiter.api.Test -import java.io.{File, FileOutputStream} -import scala.io.Source +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.PrintStream + @UseReporter(Array(classOf[DiffReporter])) +class GildedRoseApprovalTestInScala { -class GildedRoseApprovalTestInScala extends AnyFlatSpec with Matchers { - ignore should "return the result of the golden master" in { - val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") - val outputStream = new FileOutputStream(fileWithTestResult) - Console.withOut(outputStream) { + @Test + def foo(): Unit = { - TexttestFixture.main(Array("30")) - } + val items: Array[Item] = Array(new Item("foo", 0, 0)) + val app: GildedRose = new GildedRose(items); + app.updateQuality(); - val approvedFile = "approvaltests/gildedrose.approved.txt" - val sourceForTestResults = Source.fromFile(fileWithTestResult) - val sourceForApprovedFile = Source.fromFile(approvedFile) - - val resultingOutput = - try sourceForTestResults.getLines().toVector - finally sourceForTestResults.close() - val approvedOutput = - try sourceForApprovedFile.getLines().toVector - finally sourceForTestResults.close() - - resultingOutput should equal(approvedOutput) + Approvals.verifyAll("Items", items); } -} + @Test + def thirtyDays(): Unit = { + + val fakeoutput: ByteArrayOutputStream = new ByteArrayOutputStream(); + System.setOut(new PrintStream(fakeoutput)); + System.setIn(new ByteArrayInputStream("a\n".getBytes())); + + val args: Array[String] = Array("30") + TexttestFixture.main(args); + val output: String = fakeoutput.toString(); + + Approvals.verify(output); + } +} \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index e8da3d53..ad54a41e 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -3,7 +3,7 @@ package com.gildedrose object TexttestFixture { def main(args: Array[String]): Unit = { - println("OMGHAI!") + System.out.println("OMGHAI!") val items = Array[Item]( Item("+5 Dexterity Vest", 10, 20), @@ -23,12 +23,12 @@ object TexttestFixture { if (args.nonEmpty) days = args(0).toInt + 1 for (i <- 0 until days) { - println("-------- day " + i + " --------") - println("name, sellIn, quality") + System.out.println("-------- day " + i + " --------") + System.out.println("name, sellIn, quality") for (item <- items) { - println(s"${item.name}, ${item.sellIn}, ${item.quality}") + System.out.println(s"${item.name}, ${item.sellIn}, ${item.quality}") } - println() + System.out.println() app.updateQuality() } } From 5ed38a6ae3358994be9644bd0b5237afa866f2b3 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 5 Oct 2025 21:18:06 +0200 Subject: [PATCH 35/61] removed example output from approval tests --- scala/approvaltests/gildedrose.approved.txt | 373 ------------------ .../approvaltests/gildedrose.approved.txt.bak | 373 ------------------ 2 files changed, 746 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt delete mode 100644 scala/approvaltests/gildedrose.approved.txt.bak diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - diff --git a/scala/approvaltests/gildedrose.approved.txt.bak b/scala/approvaltests/gildedrose.approved.txt.bak deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt.bak +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From 639c709c995129f556a189e5e09d4dd468be88f9 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 08:22:51 +0200 Subject: [PATCH 36/61] Housekeeping --- scala/build.sbt | 11 +++--- .../src/main/scala/com/gildedrose/Item.scala | 2 +- .../src/main/scala/com/gildedrose/Main.scala | 18 ++++----- .../gildedrose/GildedRoseApprovalTest.scala | 38 +++++++++++++++++++ .../GildedRoseApprovalTestInScala.scala | 38 ------------------- .../scala/com/gildedrose/GildedRoseTest.scala | 12 +++--- 6 files changed, 59 insertions(+), 60 deletions(-) create mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala delete mode 100644 scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala diff --git a/scala/build.sbt b/scala/build.sbt index c7ab2489..f922a7cd 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -7,12 +7,11 @@ lazy val root = project version := "1.0", scalaVersion := scala3Version, libraryDependencies ++= Seq( - "org.scalatest" %% "scalatest" % "3.2.19" % Test, - "com.approvaltests" % "approvaltests" % "25.4.3" % Test, - "junit" % "junit" % "4.13.2", + "org.scalatest" %% "scalatest" % "3.2.19" % Test, + "com.approvaltests" % "approvaltests" % "25.4.3" % Test, + "junit" % "junit" % "4.13.2", "com.github.sbt.junit" % "jupiter-interface" % "0.15.1" % Test, - "org.junit.jupiter" % "junit-jupiter" % "6.0.0" % Test + "org.junit.jupiter" % "junit-jupiter" % "6.0.0" % Test ), - testOptions += Tests.Argument(TestFrameworks.JUnit) - + testOptions += Tests.Argument(TestFrameworks.JUnit) ) diff --git a/scala/src/main/scala/com/gildedrose/Item.scala b/scala/src/main/scala/com/gildedrose/Item.scala index f30ab6e2..ed4a21f3 100644 --- a/scala/src/main/scala/com/gildedrose/Item.scala +++ b/scala/src/main/scala/com/gildedrose/Item.scala @@ -1,5 +1,5 @@ package com.gildedrose -case class Item(val name: String, var sellIn: Int, var quality: Int) { +case class Item(name: String, var sellIn: Int, var quality: Int) { } \ No newline at end of file diff --git a/scala/src/main/scala/com/gildedrose/Main.scala b/scala/src/main/scala/com/gildedrose/Main.scala index fbd1cd9b..bd943be9 100644 --- a/scala/src/main/scala/com/gildedrose/Main.scala +++ b/scala/src/main/scala/com/gildedrose/Main.scala @@ -3,16 +3,16 @@ package com.gildedrose object Main { def main(args: Array[String]): Unit = { val items = Array[Item]( - new Item("+5 Dexterity Vest", 10, 20), - new Item("Aged Brie", 2, 0), - new Item("Elixir of the Mongoose", 5, 7), - new Item("Sulfuras, Hand of Ragnaros", 0, 80), - new Item("Sulfuras, Hand of Ragnaros", -1, 80), - new Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), - new Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), - new Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), + Item("+5 Dexterity Vest", 10, 20), + Item("Aged Brie", 2, 0), + Item("Elixir of the Mongoose", 5, 7), + Item("Sulfuras, Hand of Ragnaros", 0, 80), + Item("Sulfuras, Hand of Ragnaros", -1, 80), + Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), + Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), + Item("Backstage passes to a TAFKAL80ETC concert", 5, 49), // this conjured item does not work properly yet - new Item("Conjured Mana Cake", 3, 6) + Item("Conjured Mana Cake", 3, 6) ) val app = new GildedRose(items) diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala new file mode 100644 index 00000000..775b0957 --- /dev/null +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala @@ -0,0 +1,38 @@ +package com.gildedrose + +import org.approvaltests.Approvals +import org.approvaltests.reporters.DiffReporter +import org.approvaltests.reporters.UseReporter +import org.junit.jupiter.api.Test + +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.PrintStream + +@UseReporter(Array(classOf[DiffReporter])) +class GildedRoseApprovalTest { + + @Test + def foo(): Unit = { + + val items: Array[Item] = Array(Item("foo", 0, 0)) + val app: GildedRose = new GildedRose(items) + app.updateQuality() + + Approvals.verifyAll("Items", items) + } + + @Test + def thirtyDays(): Unit = { + + val fakeoutput: ByteArrayOutputStream = new ByteArrayOutputStream() + System.setOut(new PrintStream(fakeoutput)) + System.setIn(new ByteArrayInputStream("a\n".getBytes())) + + val args: Array[String] = Array("30") + TexttestFixture.main(args) + val output: String = fakeoutput.toString() + + Approvals.verify(output) + } +} diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala deleted file mode 100644 index 117d1656..00000000 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTestInScala.scala +++ /dev/null @@ -1,38 +0,0 @@ -package com.gildedrose; - -import org.approvaltests.Approvals -import org.approvaltests.reporters.DiffReporter -import org.approvaltests.reporters.UseReporter -import org.junit.jupiter.api.Test - -import java.io.ByteArrayInputStream -import java.io.ByteArrayOutputStream -import java.io.PrintStream - - @UseReporter(Array(classOf[DiffReporter])) -class GildedRoseApprovalTestInScala { - - @Test - def foo(): Unit = { - - val items: Array[Item] = Array(new Item("foo", 0, 0)) - val app: GildedRose = new GildedRose(items); - app.updateQuality(); - - Approvals.verifyAll("Items", items); - } - - @Test - def thirtyDays(): Unit = { - - val fakeoutput: ByteArrayOutputStream = new ByteArrayOutputStream(); - System.setOut(new PrintStream(fakeoutput)); - System.setIn(new ByteArrayInputStream("a\n".getBytes())); - - val args: Array[String] = Array("30") - TexttestFixture.main(args); - val output: String = fakeoutput.toString(); - - Approvals.verify(output); - } -} \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseTest.scala index 6d8c1732..a4a3d902 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseTest.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseTest.scala @@ -4,10 +4,10 @@ import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers class GildedRoseTest extends AnyFlatSpec with Matchers { - it should "foo" in { - val items = Array[Item](new Item("foo", 0, 0)) - val app = new GildedRose(items) - app.updateQuality() - app.items(0).name should equal ("fixme") - } + it should "foo" in { + val items = Array[Item](Item("foo", 0, 0)) + val app = new GildedRose(items) + app.updateQuality() + app.items(0).name should equal("fixme") + } } From 38c63d80f48a3f0c723797d3b305c906fca9ba47 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 10:03:15 +0200 Subject: [PATCH 37/61] Updated README.txt --- scala/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scala/README.md b/scala/README.md index 23ec0213..73c9a7c6 100644 --- a/scala/README.md +++ b/scala/README.md @@ -23,13 +23,13 @@ sbt test ## Run approval tests -The approval test creates a file with an result of the test fixture in approvaltests/gildedrose.testresult.txt. The very first test run will fail and the resulting gildedrose.testresult.txt can be moved/renamed to gildedrose.approved.txt. +The approval test can be found in the src/test/scala/GildedRoseApprovalTest.scala. It uses the approval test framework from https://github.com/approvals/ApprovalTests.Java. -The approval tests in the test directory under GildedRoseApprovalTest.scala will regenerate the test result on each run and compare it to the approved file. The approval test will fail when thee are any differences between the files. +The initial run will be a failing test and suggests an output to accept as the first approved version. Each subsequent run of the test will succeed until the output from the test changes. -To approve a new version simply rename the resulting test output to gildedrose.approved.txt +To approve a new version, simply accept some or all diffs between the existing approved files and the newly generated output. -Approval tests are part of the test suite triggered by sbt. +Approval tests are part of the test suite triggered by "sbt test". ``` cmd sbt test From c0d94a3f4b7e9f34a62e0be55d80f7bc6dcd875c Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 10:13:53 +0200 Subject: [PATCH 38/61] housekeeping --- scala/.gitignore | 5 ++--- scala/build.sbt | 4 +--- texttests/config.gr | 8 ++++---- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/scala/.gitignore b/scala/.gitignore index 00610921..45741ab4 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -1,6 +1,6 @@ /bin/ lib -project + # OSX Finder .DS_Store @@ -15,7 +15,7 @@ project .vscode .metals .scala-build -project/metals.sbt +metals.sbt @@ -29,4 +29,3 @@ project/metals.sbt .classpath target/ -approvaltests/gildedrose.testresult.txt diff --git a/scala/build.sbt b/scala/build.sbt index f922a7cd..91a88ae6 100644 --- a/scala/build.sbt +++ b/scala/build.sbt @@ -9,9 +9,7 @@ lazy val root = project libraryDependencies ++= Seq( "org.scalatest" %% "scalatest" % "3.2.19" % Test, "com.approvaltests" % "approvaltests" % "25.4.3" % Test, - "junit" % "junit" % "4.13.2", - "com.github.sbt.junit" % "jupiter-interface" % "0.15.1" % Test, - "org.junit.jupiter" % "junit-jupiter" % "6.0.0" % Test + "com.github.sbt.junit" % "jupiter-interface" % "0.15.1" % Test ), testOptions += Tests.Argument(TestFrameworks.JUnit) ) diff --git a/texttests/config.gr b/texttests/config.gr index 60ffe0da..17d72628 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -25,8 +25,8 @@ diff_program:meld #interpreter:python # Settings for the Java version using the classpath -# executable:com.gildedrose.TexttestFixture -# interpreter:java +#executable:com.gildedrose.TexttestFixture +#interpreter:java # note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the Kotlin version using Gradle wrapped in a python script @@ -34,8 +34,8 @@ diff_program:meld #interpreter:python # Settings for the Ruby version -#executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb -#interpreter:ruby +executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb +interpreter:ruby # Settings for the C# Core version #executable:${TEXTTEST_HOME}/csharpcore/GildedRoseTests/bin/Debug/net8.0/GildedRoseTests From 0fadc910513eebaede5e381af9318c984984f876 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 10:27:03 +0200 Subject: [PATCH 39/61] removed approvaltest directory --- scala/approvaltests/gildedrose.approved.txt | 373 ------------------ .../approvaltests/gildedrose.approved.txt.bak | 373 ------------------ 2 files changed, 746 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt delete mode 100644 scala/approvaltests/gildedrose.approved.txt.bak diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - diff --git a/scala/approvaltests/gildedrose.approved.txt.bak b/scala/approvaltests/gildedrose.approved.txt.bak deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt.bak +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From 3655d5edc7f6d71114f36ded9f217798d2134fd9 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 10:34:40 +0200 Subject: [PATCH 40/61] cleaned up texttest/config.gr --- texttests/config.gr | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/texttests/config.gr b/texttests/config.gr index 60ffe0da..17d72628 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -25,8 +25,8 @@ diff_program:meld #interpreter:python # Settings for the Java version using the classpath -# executable:com.gildedrose.TexttestFixture -# interpreter:java +#executable:com.gildedrose.TexttestFixture +#interpreter:java # note you'll also need to update the file environment.gr with your classpath if you keep your classfiles somewhere unusual # Settings for the Kotlin version using Gradle wrapped in a python script @@ -34,8 +34,8 @@ diff_program:meld #interpreter:python # Settings for the Ruby version -#executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb -#interpreter:ruby +executable:${TEXTTEST_HOME}/ruby/texttest_fixture.rb +interpreter:ruby # Settings for the C# Core version #executable:${TEXTTEST_HOME}/csharpcore/GildedRoseTests/bin/Debug/net8.0/GildedRoseTests From 46d05866585219a004c587e6bc4f5dbae4295af6 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 15:05:50 +0200 Subject: [PATCH 41/61] * converted Java TextestFixture to scala --- .../test/scala/com/gildedrose/TexttestFixture.scala | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index ad54a41e..47ec57fd 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -1,15 +1,15 @@ package com.gildedrose object TexttestFixture { - + @main def main(args: Array[String]): Unit = { System.out.println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), - Item("Aged Brie", 2, 0), - Item("Elixir of the Mongoose", 5, 7), - Item("Sulfuras, Hand of Ragnaros", 0, 80), + Item("+5 Dexterity Vest", 10, 20), // + Item("Aged Brie", 2, 0), // + Item("Elixir of the Mongoose", 5, 7), // + Item("Sulfuras, Hand of Ragnaros", 0, 80), // Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), From cf00776b11ec32e37b296143ba320e874be2b75a Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 19:47:35 +0200 Subject: [PATCH 42/61] added .bloop and vscode directories for scala to .gitignore --- scala/.gitignore | 2 -- 1 file changed, 2 deletions(-) diff --git a/scala/.gitignore b/scala/.gitignore index 45741ab4..4cd40b29 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -1,6 +1,4 @@ /bin/ -lib - # OSX Finder .DS_Store From 144bb639121805080d14d848e0969f649af6184a Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Thu, 18 Sep 2025 22:00:26 +0200 Subject: [PATCH 43/61] cleaned up texttest_rig.py --- texttests/ThirtyDays/stdout.gr | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index a04e48ac..486bd1ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,3 +1,40 @@ +[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) +[info] loading global plugins from /Users/rco/.sbt/1.0/plugins +[info] loading settings for project scala-build-build from metals.sbt... +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project +[success] Generated .bloop/scala-build.json +[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[info] loading settings for project root from build.sbt... +[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) +[info] running com.gildedrose.Main +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -371,3 +408,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 From c31a479ecbb86464ab731100de522a4db8730efb Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 21:14:05 +0200 Subject: [PATCH 44/61] removed extra, unnecessary run in texttest_rig.py --- texttests/ThirtyDays/stdout.gr | 35 ++++++---------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 486bd1ac..3edea854 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -4,36 +4,13 @@ [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project [info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project [success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[success] Total time: 1 s, completed 26.09.2025, 20:16:59 [info] loading settings for project root from build.sbt... [info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] running com.gildedrose.Main -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... +[info] done compiling +[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... +[info] done compiling [info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- @@ -408,4 +385,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[success] Total time: 2 s, completed 26.09.2025, 20:17:01 From 23dba8c86a5077963e627ae46a9e501b237f8a31 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 45/61] setup approval tests with golden master using scalatest --- scala/.gitignore | 1 + scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++ .../gildedrose/GildedRoseApprovalTest.scala | 50 ++- 3 files changed, 396 insertions(+), 28 deletions(-) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/.gitignore b/scala/.gitignore index 4cd40b29..cd006698 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -27,3 +27,4 @@ metals.sbt .classpath target/ +approvaltests/gildedrose.testresult.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala index 775b0957..32224404 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala @@ -1,38 +1,32 @@ package com.gildedrose -import org.approvaltests.Approvals -import org.approvaltests.reporters.DiffReporter -import org.approvaltests.reporters.UseReporter -import org.junit.jupiter.api.Test +import org.scalatest.flatspec.AnyFlatSpec +import org.scalatest.matchers.should.Matchers -import java.io.ByteArrayInputStream -import java.io.ByteArrayOutputStream -import java.io.PrintStream +import java.io.{File, FileOutputStream} +import scala.io.Source -@UseReporter(Array(classOf[DiffReporter])) -class GildedRoseApprovalTest { +class GildedRoseApprovalTest extends AnyFlatSpec with Matchers { + it should "return the result of the golden master" in { + val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") + val outputStream = new FileOutputStream(fileWithTestResult) + Console.withOut(outputStream) { - @Test - def foo(): Unit = { + TexttestFixture.main(Array("30")) + } - val items: Array[Item] = Array(Item("foo", 0, 0)) - val app: GildedRose = new GildedRose(items) - app.updateQuality() + val approvedFile = "approvaltests/gildedrose.approved.txt" + val sourceForTestResults = Source.fromFile(fileWithTestResult) + val sourceForApprovedFile = Source.fromFile(approvedFile) - Approvals.verifyAll("Items", items) + val resultingOutput = + try sourceForTestResults.getLines().toVector + finally sourceForTestResults.close() + val approvedOutput = + try sourceForApprovedFile.getLines().toVector + finally sourceForTestResults.close() + + resultingOutput should equal(approvedOutput) } - @Test - def thirtyDays(): Unit = { - - val fakeoutput: ByteArrayOutputStream = new ByteArrayOutputStream() - System.setOut(new PrintStream(fakeoutput)) - System.setIn(new ByteArrayInputStream("a\n".getBytes())) - - val args: Array[String] = Array("30") - TexttestFixture.main(args) - val output: String = fakeoutput.toString() - - Approvals.verify(output) - } } From 0a08d92b9509e096df49f36793d98252f45f2f73 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sun, 28 Sep 2025 10:49:02 +0200 Subject: [PATCH 46/61] removed unnecessary comment markers at line ends in TexttestFixture.scala --- scala/src/test/scala/com/gildedrose/TexttestFixture.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index 47ec57fd..29551be6 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -6,10 +6,10 @@ object TexttestFixture { System.out.println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), // - Item("Aged Brie", 2, 0), // - Item("Elixir of the Mongoose", 5, 7), // - Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("+5 Dexterity Vest", 10, 20), + Item("Aged Brie", 2, 0), + Item("Elixir of the Mongoose", 5, 7), + Item("Sulfuras, Hand of Ragnaros", 0, 80), Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), From f3e62e2bbbe46acd644bd0fb9a7d27f95a6f1bc7 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 12:06:17 +0200 Subject: [PATCH 47/61] merged with origin --- .../gildedrose/GildedRoseApprovalTest.scala | 52 +++++++++++-------- .../com/gildedrose/TexttestFixture.scala | 1 - 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala index 32224404..b9dd58ef 100644 --- a/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala +++ b/scala/src/test/scala/com/gildedrose/GildedRoseApprovalTest.scala @@ -1,32 +1,38 @@ package com.gildedrose -import org.scalatest.flatspec.AnyFlatSpec -import org.scalatest.matchers.should.Matchers +import org.approvaltests.Approvals +import org.approvaltests.reporters.DiffReporter +import org.approvaltests.reporters.UseReporter +import org.junit.jupiter.api.Test -import java.io.{File, FileOutputStream} -import scala.io.Source +import java.io.ByteArrayInputStream +import java.io.ByteArrayOutputStream +import java.io.PrintStream -class GildedRoseApprovalTest extends AnyFlatSpec with Matchers { - it should "return the result of the golden master" in { - val fileWithTestResult = new File("approvaltests/gildedrose.testresult.txt") - val outputStream = new FileOutputStream(fileWithTestResult) - Console.withOut(outputStream) { +@UseReporter(Array(classOf[DiffReporter])) +class GildedRoseApprovalTest { - TexttestFixture.main(Array("30")) - } + @Test + def foo(): Unit = { - val approvedFile = "approvaltests/gildedrose.approved.txt" - val sourceForTestResults = Source.fromFile(fileWithTestResult) - val sourceForApprovedFile = Source.fromFile(approvedFile) + val items: Array[Item] = Array(Item("foo", 0, 0)) + val app: GildedRose = new GildedRose(items) + app.updateQuality() - val resultingOutput = - try sourceForTestResults.getLines().toVector - finally sourceForTestResults.close() - val approvedOutput = - try sourceForApprovedFile.getLines().toVector - finally sourceForTestResults.close() - - resultingOutput should equal(approvedOutput) + Approvals.verifyAll("Items", items) } -} + @Test + def thirtyDays(): Unit = { + + val fakeoutput: ByteArrayOutputStream = new ByteArrayOutputStream() + System.setOut(new PrintStream(fakeoutput)) + System.setIn(new ByteArrayInputStream("a\n".getBytes())) + + val args: Array[String] = Array("30") + TexttestFixture.main(args) + val output: String = fakeoutput.toString() + + Approvals.verify(output) + } +} \ No newline at end of file diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index 29551be6..4e6fc7f4 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -1,7 +1,6 @@ package com.gildedrose object TexttestFixture { - @main def main(args: Array[String]): Unit = { System.out.println("OMGHAI!") From f2da40423d1e708558422ff4d64b488695c1c239 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 12:19:41 +0200 Subject: [PATCH 48/61] removed old approvaltest directory --- scala/approvaltests/gildedrose.approved.txt | 373 -------------------- 1 file changed, 373 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From 86a7bbaf6d73d9ff2d53e2d9ae590b5089d14527 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 13 Sep 2025 10:57:03 +0200 Subject: [PATCH 49/61] updated .gitignore --- scala/.gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index cd006698..5b353050 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -8,6 +8,8 @@ *.iml .bsp .bloop +.bsp +.bloop #vscode .vscode From d745f6452af1d51634c2c9d7242bedc5cf150904 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 15 Sep 2025 15:05:50 +0200 Subject: [PATCH 50/61] * converted Java TextestFixture to scala --- scala/src/test/scala/com/gildedrose/TexttestFixture.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index 4e6fc7f4..c941be1f 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -5,10 +5,10 @@ object TexttestFixture { System.out.println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), - Item("Aged Brie", 2, 0), - Item("Elixir of the Mongoose", 5, 7), - Item("Sulfuras, Hand of Ragnaros", 0, 80), + Item("+5 Dexterity Vest", 10, 20), // + Item("Aged Brie", 2, 0), // + Item("Elixir of the Mongoose", 5, 7), // + Item("Sulfuras, Hand of Ragnaros", 0, 80), // Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), From f00df0e4ae2603c0dd2989fe269f5c30b99c9617 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Fri, 26 Sep 2025 19:47:35 +0200 Subject: [PATCH 51/61] added .bloop and vscode directories for scala to .gitignore --- scala/.gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scala/.gitignore b/scala/.gitignore index 5b353050..c56b917b 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -19,6 +19,14 @@ metals.sbt +#vscode +.vscode +.metals +.scala-build +project/metals.sbt + + + # Eclipse .worksheet .settings From 24c992acb714371082383dfd273fde860ef05e8f Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Thu, 18 Sep 2025 22:00:26 +0200 Subject: [PATCH 52/61] cleaned up texttest_rig.py --- texttests/ThirtyDays/stdout.gr | 15 --------------- texttests/config.gr | 5 ----- 2 files changed, 20 deletions(-) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 3edea854..a04e48ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,17 +1,3 @@ -[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) -[info] loading global plugins from /Users/rco/.sbt/1.0/plugins -[info] loading settings for project scala-build-build from metals.sbt... -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project -[success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:16:59 -[info] loading settings for project root from build.sbt... -[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] compiling 3 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/classes ... -[info] done compiling -[info] compiling 2 Scala sources to /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/target/scala-3.7.3/test-classes ... -[info] done compiling -[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -385,4 +371,3 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 2 s, completed 26.09.2025, 20:17:01 diff --git a/texttests/config.gr b/texttests/config.gr index 17d72628..8bafed03 100755 --- a/texttests/config.gr +++ b/texttests/config.gr @@ -77,8 +77,3 @@ interpreter:ruby filename_convention_scheme:standard - -# uncomment for the scala version using sbt wrapped into python -#[run_dependent_text] -#stdout:\[info\] -#stdout:\[success\] From f8262a4396c8c8809b53e7de324f93f8feb69e81 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 53/61] setup approval tests with golden master using scalatest --- scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + From e8a80b803405c35851de464121dfbbe14cb24158 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 15:36:24 +0200 Subject: [PATCH 54/61] removed approvaltests directory --- scala/approvaltests/gildedrose.approved.txt | 373 -------------------- 1 file changed, 373 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From e838a75365d4d2dccb621ae83ab1a4d4a7ec1f2e Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 15:50:16 +0200 Subject: [PATCH 55/61] suppressed sbt specific output --- scala/.gitignore | 10 +--------- .../test/scala/com/gildedrose/TexttestFixture.scala | 8 ++++---- scala/texttest_rig.py | 2 +- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/scala/.gitignore b/scala/.gitignore index c56b917b..ec0b3283 100644 --- a/scala/.gitignore +++ b/scala/.gitignore @@ -1,4 +1,5 @@ /bin/ +lib/ # OSX Finder .DS_Store @@ -8,8 +9,6 @@ *.iml .bsp .bloop -.bsp -.bloop #vscode .vscode @@ -19,13 +18,6 @@ metals.sbt -#vscode -.vscode -.metals -.scala-build -project/metals.sbt - - # Eclipse .worksheet diff --git a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala index c941be1f..4e6fc7f4 100644 --- a/scala/src/test/scala/com/gildedrose/TexttestFixture.scala +++ b/scala/src/test/scala/com/gildedrose/TexttestFixture.scala @@ -5,10 +5,10 @@ object TexttestFixture { System.out.println("OMGHAI!") val items = Array[Item]( - Item("+5 Dexterity Vest", 10, 20), // - Item("Aged Brie", 2, 0), // - Item("Elixir of the Mongoose", 5, 7), // - Item("Sulfuras, Hand of Ragnaros", 0, 80), // + Item("+5 Dexterity Vest", 10, 20), + Item("Aged Brie", 2, 0), + Item("Elixir of the Mongoose", 5, 7), + Item("Sulfuras, Hand of Ragnaros", 0, 80), Item("Sulfuras, Hand of Ragnaros", -1, 80), Item("Backstage passes to a TAFKAL80ETC concert", 15, 20), Item("Backstage passes to a TAFKAL80ETC concert", 10, 49), diff --git a/scala/texttest_rig.py b/scala/texttest_rig.py index 23bd74f7..c4302638 100644 --- a/scala/texttest_rig.py +++ b/scala/texttest_rig.py @@ -11,4 +11,4 @@ import sys args = " ".join(sys.argv[1:]) TEXTTEST_HOME = os.environ.get("TEXTTEST_HOME", os.getcwd()) -subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) +subprocess.run(f"""(cd {TEXTTEST_HOME}/scala/; sbt -warn "Test / runMain com.gildedrose.TexttestFixture {args}") """, shell=True) From 24a86e2df16b2e837880ceff667a964d137a9796 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Thu, 18 Sep 2025 22:00:26 +0200 Subject: [PATCH 56/61] cleaned up texttest_rig.py --- texttests/ThirtyDays/stdout.gr | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index a04e48ac..486bd1ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,3 +1,40 @@ +[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) +[info] loading global plugins from /Users/rco/.sbt/1.0/plugins +[info] loading settings for project scala-build-build from metals.sbt... +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project +[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project +[success] Generated .bloop/scala-build.json +[success] Total time: 1 s, completed 26.09.2025, 20:01:30 +[info] loading settings for project root from build.sbt... +[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) +[info] running com.gildedrose.Main +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 +[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -371,3 +408,4 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 +[success] Total time: 0 s, completed 26.09.2025, 20:01:31 From 1ddc66a98ae942f2982ce67a0127a43b78c1cd29 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 57/61] setup approval tests with golden master using scalatest --- scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + From 1aa971f8850de8cee1a339fc23d013815048eca9 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 16:26:26 +0200 Subject: [PATCH 58/61] approvaltests/gildedrose.approved.txt removed --- scala/approvaltests/gildedrose.approved.txt | 373 -------------------- 1 file changed, 373 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From f5242736c7926182642bbda8aa29308319a5061b Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 27 Sep 2025 12:01:09 +0200 Subject: [PATCH 59/61] setup approval tests with golden master using scalatest --- scala/approvaltests/gildedrose.approved.txt | 373 ++++++++++++++++++++ 1 file changed, 373 insertions(+) create mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt new file mode 100644 index 00000000..a04e48ac --- /dev/null +++ b/scala/approvaltests/gildedrose.approved.txt @@ -0,0 +1,373 @@ +OMGHAI! +-------- day 0 -------- +name, sellIn, quality ++5 Dexterity Vest, 10, 20 +Aged Brie, 2, 0 +Elixir of the Mongoose, 5, 7 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 15, 20 +Backstage passes to a TAFKAL80ETC concert, 10, 49 +Backstage passes to a TAFKAL80ETC concert, 5, 49 +Conjured Mana Cake, 3, 6 + +-------- day 1 -------- +name, sellIn, quality ++5 Dexterity Vest, 9, 19 +Aged Brie, 1, 1 +Elixir of the Mongoose, 4, 6 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 14, 21 +Backstage passes to a TAFKAL80ETC concert, 9, 50 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Conjured Mana Cake, 2, 5 + +-------- day 2 -------- +name, sellIn, quality ++5 Dexterity Vest, 8, 18 +Aged Brie, 0, 2 +Elixir of the Mongoose, 3, 5 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 13, 22 +Backstage passes to a TAFKAL80ETC concert, 8, 50 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Conjured Mana Cake, 1, 4 + +-------- day 3 -------- +name, sellIn, quality ++5 Dexterity Vest, 7, 17 +Aged Brie, -1, 4 +Elixir of the Mongoose, 2, 4 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 12, 23 +Backstage passes to a TAFKAL80ETC concert, 7, 50 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Conjured Mana Cake, 0, 3 + +-------- day 4 -------- +name, sellIn, quality ++5 Dexterity Vest, 6, 16 +Aged Brie, -2, 6 +Elixir of the Mongoose, 1, 3 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 11, 24 +Backstage passes to a TAFKAL80ETC concert, 6, 50 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Conjured Mana Cake, -1, 1 + +-------- day 5 -------- +name, sellIn, quality ++5 Dexterity Vest, 5, 15 +Aged Brie, -3, 8 +Elixir of the Mongoose, 0, 2 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 10, 25 +Backstage passes to a TAFKAL80ETC concert, 5, 50 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Conjured Mana Cake, -2, 0 + +-------- day 6 -------- +name, sellIn, quality ++5 Dexterity Vest, 4, 14 +Aged Brie, -4, 10 +Elixir of the Mongoose, -1, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 9, 27 +Backstage passes to a TAFKAL80ETC concert, 4, 50 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Conjured Mana Cake, -3, 0 + +-------- day 7 -------- +name, sellIn, quality ++5 Dexterity Vest, 3, 13 +Aged Brie, -5, 12 +Elixir of the Mongoose, -2, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 8, 29 +Backstage passes to a TAFKAL80ETC concert, 3, 50 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Conjured Mana Cake, -4, 0 + +-------- day 8 -------- +name, sellIn, quality ++5 Dexterity Vest, 2, 12 +Aged Brie, -6, 14 +Elixir of the Mongoose, -3, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 7, 31 +Backstage passes to a TAFKAL80ETC concert, 2, 50 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Conjured Mana Cake, -5, 0 + +-------- day 9 -------- +name, sellIn, quality ++5 Dexterity Vest, 1, 11 +Aged Brie, -7, 16 +Elixir of the Mongoose, -4, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 6, 33 +Backstage passes to a TAFKAL80ETC concert, 1, 50 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Conjured Mana Cake, -6, 0 + +-------- day 10 -------- +name, sellIn, quality ++5 Dexterity Vest, 0, 10 +Aged Brie, -8, 18 +Elixir of the Mongoose, -5, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 5, 35 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Conjured Mana Cake, -7, 0 + +-------- day 11 -------- +name, sellIn, quality ++5 Dexterity Vest, -1, 8 +Aged Brie, -9, 20 +Elixir of the Mongoose, -6, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 4, 38 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Conjured Mana Cake, -8, 0 + +-------- day 12 -------- +name, sellIn, quality ++5 Dexterity Vest, -2, 6 +Aged Brie, -10, 22 +Elixir of the Mongoose, -7, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 3, 41 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Conjured Mana Cake, -9, 0 + +-------- day 13 -------- +name, sellIn, quality ++5 Dexterity Vest, -3, 4 +Aged Brie, -11, 24 +Elixir of the Mongoose, -8, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 2, 44 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Conjured Mana Cake, -10, 0 + +-------- day 14 -------- +name, sellIn, quality ++5 Dexterity Vest, -4, 2 +Aged Brie, -12, 26 +Elixir of the Mongoose, -9, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 1, 47 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Conjured Mana Cake, -11, 0 + +-------- day 15 -------- +name, sellIn, quality ++5 Dexterity Vest, -5, 0 +Aged Brie, -13, 28 +Elixir of the Mongoose, -10, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, 0, 50 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Conjured Mana Cake, -12, 0 + +-------- day 16 -------- +name, sellIn, quality ++5 Dexterity Vest, -6, 0 +Aged Brie, -14, 30 +Elixir of the Mongoose, -11, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -1, 0 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Conjured Mana Cake, -13, 0 + +-------- day 17 -------- +name, sellIn, quality ++5 Dexterity Vest, -7, 0 +Aged Brie, -15, 32 +Elixir of the Mongoose, -12, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -2, 0 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Conjured Mana Cake, -14, 0 + +-------- day 18 -------- +name, sellIn, quality ++5 Dexterity Vest, -8, 0 +Aged Brie, -16, 34 +Elixir of the Mongoose, -13, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -3, 0 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Conjured Mana Cake, -15, 0 + +-------- day 19 -------- +name, sellIn, quality ++5 Dexterity Vest, -9, 0 +Aged Brie, -17, 36 +Elixir of the Mongoose, -14, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -4, 0 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Conjured Mana Cake, -16, 0 + +-------- day 20 -------- +name, sellIn, quality ++5 Dexterity Vest, -10, 0 +Aged Brie, -18, 38 +Elixir of the Mongoose, -15, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -5, 0 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Conjured Mana Cake, -17, 0 + +-------- day 21 -------- +name, sellIn, quality ++5 Dexterity Vest, -11, 0 +Aged Brie, -19, 40 +Elixir of the Mongoose, -16, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -6, 0 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Conjured Mana Cake, -18, 0 + +-------- day 22 -------- +name, sellIn, quality ++5 Dexterity Vest, -12, 0 +Aged Brie, -20, 42 +Elixir of the Mongoose, -17, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -7, 0 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Conjured Mana Cake, -19, 0 + +-------- day 23 -------- +name, sellIn, quality ++5 Dexterity Vest, -13, 0 +Aged Brie, -21, 44 +Elixir of the Mongoose, -18, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -8, 0 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Conjured Mana Cake, -20, 0 + +-------- day 24 -------- +name, sellIn, quality ++5 Dexterity Vest, -14, 0 +Aged Brie, -22, 46 +Elixir of the Mongoose, -19, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -9, 0 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Conjured Mana Cake, -21, 0 + +-------- day 25 -------- +name, sellIn, quality ++5 Dexterity Vest, -15, 0 +Aged Brie, -23, 48 +Elixir of the Mongoose, -20, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -10, 0 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Conjured Mana Cake, -22, 0 + +-------- day 26 -------- +name, sellIn, quality ++5 Dexterity Vest, -16, 0 +Aged Brie, -24, 50 +Elixir of the Mongoose, -21, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -11, 0 +Backstage passes to a TAFKAL80ETC concert, -16, 0 +Backstage passes to a TAFKAL80ETC concert, -21, 0 +Conjured Mana Cake, -23, 0 + +-------- day 27 -------- +name, sellIn, quality ++5 Dexterity Vest, -17, 0 +Aged Brie, -25, 50 +Elixir of the Mongoose, -22, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -12, 0 +Backstage passes to a TAFKAL80ETC concert, -17, 0 +Backstage passes to a TAFKAL80ETC concert, -22, 0 +Conjured Mana Cake, -24, 0 + +-------- day 28 -------- +name, sellIn, quality ++5 Dexterity Vest, -18, 0 +Aged Brie, -26, 50 +Elixir of the Mongoose, -23, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -13, 0 +Backstage passes to a TAFKAL80ETC concert, -18, 0 +Backstage passes to a TAFKAL80ETC concert, -23, 0 +Conjured Mana Cake, -25, 0 + +-------- day 29 -------- +name, sellIn, quality ++5 Dexterity Vest, -19, 0 +Aged Brie, -27, 50 +Elixir of the Mongoose, -24, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -14, 0 +Backstage passes to a TAFKAL80ETC concert, -19, 0 +Backstage passes to a TAFKAL80ETC concert, -24, 0 +Conjured Mana Cake, -26, 0 + +-------- day 30 -------- +name, sellIn, quality ++5 Dexterity Vest, -20, 0 +Aged Brie, -28, 50 +Elixir of the Mongoose, -25, 0 +Sulfuras, Hand of Ragnaros, 0, 80 +Sulfuras, Hand of Ragnaros, -1, 80 +Backstage passes to a TAFKAL80ETC concert, -15, 0 +Backstage passes to a TAFKAL80ETC concert, -20, 0 +Backstage passes to a TAFKAL80ETC concert, -25, 0 +Conjured Mana Cake, -27, 0 + From 96623040a5a61684fe02a5f1ce56bca9e545ead5 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 16:38:00 +0200 Subject: [PATCH 60/61] approvaltests/gildedrose.approved.txt removed --- scala/approvaltests/gildedrose.approved.txt | 373 -------------------- 1 file changed, 373 deletions(-) delete mode 100644 scala/approvaltests/gildedrose.approved.txt diff --git a/scala/approvaltests/gildedrose.approved.txt b/scala/approvaltests/gildedrose.approved.txt deleted file mode 100644 index a04e48ac..00000000 --- a/scala/approvaltests/gildedrose.approved.txt +++ /dev/null @@ -1,373 +0,0 @@ -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - --------- day 2 -------- -name, sellIn, quality -+5 Dexterity Vest, 8, 18 -Aged Brie, 0, 2 -Elixir of the Mongoose, 3, 5 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 13, 22 -Backstage passes to a TAFKAL80ETC concert, 8, 50 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Conjured Mana Cake, 1, 4 - --------- day 3 -------- -name, sellIn, quality -+5 Dexterity Vest, 7, 17 -Aged Brie, -1, 4 -Elixir of the Mongoose, 2, 4 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 12, 23 -Backstage passes to a TAFKAL80ETC concert, 7, 50 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Conjured Mana Cake, 0, 3 - --------- day 4 -------- -name, sellIn, quality -+5 Dexterity Vest, 6, 16 -Aged Brie, -2, 6 -Elixir of the Mongoose, 1, 3 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 11, 24 -Backstage passes to a TAFKAL80ETC concert, 6, 50 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Conjured Mana Cake, -1, 1 - --------- day 5 -------- -name, sellIn, quality -+5 Dexterity Vest, 5, 15 -Aged Brie, -3, 8 -Elixir of the Mongoose, 0, 2 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 10, 25 -Backstage passes to a TAFKAL80ETC concert, 5, 50 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Conjured Mana Cake, -2, 0 - --------- day 6 -------- -name, sellIn, quality -+5 Dexterity Vest, 4, 14 -Aged Brie, -4, 10 -Elixir of the Mongoose, -1, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 9, 27 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Conjured Mana Cake, -3, 0 - --------- day 7 -------- -name, sellIn, quality -+5 Dexterity Vest, 3, 13 -Aged Brie, -5, 12 -Elixir of the Mongoose, -2, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 8, 29 -Backstage passes to a TAFKAL80ETC concert, 3, 50 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Conjured Mana Cake, -4, 0 - --------- day 8 -------- -name, sellIn, quality -+5 Dexterity Vest, 2, 12 -Aged Brie, -6, 14 -Elixir of the Mongoose, -3, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 7, 31 -Backstage passes to a TAFKAL80ETC concert, 2, 50 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Conjured Mana Cake, -5, 0 - --------- day 9 -------- -name, sellIn, quality -+5 Dexterity Vest, 1, 11 -Aged Brie, -7, 16 -Elixir of the Mongoose, -4, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 6, 33 -Backstage passes to a TAFKAL80ETC concert, 1, 50 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Conjured Mana Cake, -6, 0 - --------- day 10 -------- -name, sellIn, quality -+5 Dexterity Vest, 0, 10 -Aged Brie, -8, 18 -Elixir of the Mongoose, -5, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 5, 35 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Conjured Mana Cake, -7, 0 - --------- day 11 -------- -name, sellIn, quality -+5 Dexterity Vest, -1, 8 -Aged Brie, -9, 20 -Elixir of the Mongoose, -6, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 4, 38 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Conjured Mana Cake, -8, 0 - --------- day 12 -------- -name, sellIn, quality -+5 Dexterity Vest, -2, 6 -Aged Brie, -10, 22 -Elixir of the Mongoose, -7, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 3, 41 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Conjured Mana Cake, -9, 0 - --------- day 13 -------- -name, sellIn, quality -+5 Dexterity Vest, -3, 4 -Aged Brie, -11, 24 -Elixir of the Mongoose, -8, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 2, 44 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Conjured Mana Cake, -10, 0 - --------- day 14 -------- -name, sellIn, quality -+5 Dexterity Vest, -4, 2 -Aged Brie, -12, 26 -Elixir of the Mongoose, -9, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 1, 47 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Conjured Mana Cake, -11, 0 - --------- day 15 -------- -name, sellIn, quality -+5 Dexterity Vest, -5, 0 -Aged Brie, -13, 28 -Elixir of the Mongoose, -10, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 0, 50 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Conjured Mana Cake, -12, 0 - --------- day 16 -------- -name, sellIn, quality -+5 Dexterity Vest, -6, 0 -Aged Brie, -14, 30 -Elixir of the Mongoose, -11, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -1, 0 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Conjured Mana Cake, -13, 0 - --------- day 17 -------- -name, sellIn, quality -+5 Dexterity Vest, -7, 0 -Aged Brie, -15, 32 -Elixir of the Mongoose, -12, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -2, 0 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Conjured Mana Cake, -14, 0 - --------- day 18 -------- -name, sellIn, quality -+5 Dexterity Vest, -8, 0 -Aged Brie, -16, 34 -Elixir of the Mongoose, -13, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -3, 0 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Conjured Mana Cake, -15, 0 - --------- day 19 -------- -name, sellIn, quality -+5 Dexterity Vest, -9, 0 -Aged Brie, -17, 36 -Elixir of the Mongoose, -14, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -4, 0 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Conjured Mana Cake, -16, 0 - --------- day 20 -------- -name, sellIn, quality -+5 Dexterity Vest, -10, 0 -Aged Brie, -18, 38 -Elixir of the Mongoose, -15, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -5, 0 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Conjured Mana Cake, -17, 0 - --------- day 21 -------- -name, sellIn, quality -+5 Dexterity Vest, -11, 0 -Aged Brie, -19, 40 -Elixir of the Mongoose, -16, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -6, 0 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Conjured Mana Cake, -18, 0 - --------- day 22 -------- -name, sellIn, quality -+5 Dexterity Vest, -12, 0 -Aged Brie, -20, 42 -Elixir of the Mongoose, -17, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -7, 0 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Conjured Mana Cake, -19, 0 - --------- day 23 -------- -name, sellIn, quality -+5 Dexterity Vest, -13, 0 -Aged Brie, -21, 44 -Elixir of the Mongoose, -18, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -8, 0 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Conjured Mana Cake, -20, 0 - --------- day 24 -------- -name, sellIn, quality -+5 Dexterity Vest, -14, 0 -Aged Brie, -22, 46 -Elixir of the Mongoose, -19, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -9, 0 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Conjured Mana Cake, -21, 0 - --------- day 25 -------- -name, sellIn, quality -+5 Dexterity Vest, -15, 0 -Aged Brie, -23, 48 -Elixir of the Mongoose, -20, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -10, 0 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Conjured Mana Cake, -22, 0 - --------- day 26 -------- -name, sellIn, quality -+5 Dexterity Vest, -16, 0 -Aged Brie, -24, 50 -Elixir of the Mongoose, -21, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -11, 0 -Backstage passes to a TAFKAL80ETC concert, -16, 0 -Backstage passes to a TAFKAL80ETC concert, -21, 0 -Conjured Mana Cake, -23, 0 - --------- day 27 -------- -name, sellIn, quality -+5 Dexterity Vest, -17, 0 -Aged Brie, -25, 50 -Elixir of the Mongoose, -22, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -12, 0 -Backstage passes to a TAFKAL80ETC concert, -17, 0 -Backstage passes to a TAFKAL80ETC concert, -22, 0 -Conjured Mana Cake, -24, 0 - --------- day 28 -------- -name, sellIn, quality -+5 Dexterity Vest, -18, 0 -Aged Brie, -26, 50 -Elixir of the Mongoose, -23, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -13, 0 -Backstage passes to a TAFKAL80ETC concert, -18, 0 -Backstage passes to a TAFKAL80ETC concert, -23, 0 -Conjured Mana Cake, -25, 0 - --------- day 29 -------- -name, sellIn, quality -+5 Dexterity Vest, -19, 0 -Aged Brie, -27, 50 -Elixir of the Mongoose, -24, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -14, 0 -Backstage passes to a TAFKAL80ETC concert, -19, 0 -Backstage passes to a TAFKAL80ETC concert, -24, 0 -Conjured Mana Cake, -26, 0 - --------- day 30 -------- -name, sellIn, quality -+5 Dexterity Vest, -20, 0 -Aged Brie, -28, 50 -Elixir of the Mongoose, -25, 0 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, -15, 0 -Backstage passes to a TAFKAL80ETC concert, -20, 0 -Backstage passes to a TAFKAL80ETC concert, -25, 0 -Conjured Mana Cake, -27, 0 - From 95fe7d55ff9275562dded28b064bb529be049c36 Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Mon, 6 Oct 2025 16:38:00 +0200 Subject: [PATCH 61/61] approvaltests/gildedrose.approved.txt removed --- texttests/ThirtyDays/stdout.gr | 38 ---------------------------------- 1 file changed, 38 deletions(-) diff --git a/texttests/ThirtyDays/stdout.gr b/texttests/ThirtyDays/stdout.gr index 486bd1ac..a04e48ac 100644 --- a/texttests/ThirtyDays/stdout.gr +++ b/texttests/ThirtyDays/stdout.gr @@ -1,40 +1,3 @@ -[info] welcome to sbt 1.11.6 (Azul Systems, Inc. Java 21.0.8) -[info] loading global plugins from /Users/rco/.sbt/1.0/plugins -[info] loading settings for project scala-build-build from metals.sbt... -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project/project -[info] loading project definition from /Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/project -[success] Generated .bloop/scala-build.json -[success] Total time: 1 s, completed 26.09.2025, 20:01:30 -[info] loading settings for project root from build.sbt... -[info] set current project to GildedRose (in build file:/Users/rco/Developer/katas/GildedRose-Refactoring-Kata/scala/) -[info] running com.gildedrose.Main -OMGHAI! --------- day 0 -------- -name, sellIn, quality -+5 Dexterity Vest, 10, 20 -Aged Brie, 2, 0 -Elixir of the Mongoose, 5, 7 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 15, 20 -Backstage passes to a TAFKAL80ETC concert, 10, 49 -Backstage passes to a TAFKAL80ETC concert, 5, 49 -Conjured Mana Cake, 3, 6 - --------- day 1 -------- -name, sellIn, quality -+5 Dexterity Vest, 9, 19 -Aged Brie, 1, 1 -Elixir of the Mongoose, 4, 6 -Sulfuras, Hand of Ragnaros, 0, 80 -Sulfuras, Hand of Ragnaros, -1, 80 -Backstage passes to a TAFKAL80ETC concert, 14, 21 -Backstage passes to a TAFKAL80ETC concert, 9, 50 -Backstage passes to a TAFKAL80ETC concert, 4, 50 -Conjured Mana Cake, 2, 5 - -[success] Total time: 0 s, completed 26.09.2025, 20:01:31 -[info] running com.gildedrose.TexttestFixture 30 OMGHAI! -------- day 0 -------- name, sellIn, quality @@ -408,4 +371,3 @@ Backstage passes to a TAFKAL80ETC concert, -20, 0 Backstage passes to a TAFKAL80ETC concert, -25, 0 Conjured Mana Cake, -27, 0 -[success] Total time: 0 s, completed 26.09.2025, 20:01:31