From 2685188ec823a8a1763280909922db7fb6eb882a Mon Sep 17 00:00:00 2001 From: Ralf Comtesse Date: Sat, 13 Sep 2025 10:57:03 +0200 Subject: [PATCH 01/15] 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/15] * 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/15] * 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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/15] 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