Getting errors trying to run examples
Hi there, I can't seem to easily start running the examples. After cloning, I ran sbt test but got:
Implicit parameters should be provided with a `using` clause.
assert(xs.min(om) == expected)
I resolved this - not sure if done the right way - by doing:
assert(xs.min(using om) == expected)
But then I get other errors:
invariantEnabled(thing.label == "enabled")
Failed to evaluate macro.
Caused by java.lang.ClassNotFoundException: progscala3.meta.performance.invariantEnabled
As well as for class invariantMinInline
I am on openjdk 21.0.3 LTS and sbt 1.11.2
Thanks for reporting this. A breaking change in Scala 3.7 apparently. I'll work on a fix today.
I pushed fixes for the compiled code, so that sbt test should now work cleanly. There are still compilation bugs in the script examples, which I'll work on this evening.
Thanks! sbt test is working now, although there are some failing tests. Are they to be expected? For example:
progscala3.forcomps.RemoveBlanksSuite:
==> X progscala3.forcomps.RemoveBlanksSuite.RemoveBlanks removes blank lines in text 0.034s munit.FailException: src\test\scala\progscala3\forcomps\RemoveBlanksSuite.scala:15
14: |test file""".stripMargin
15: assert(actual == expected, s"""Actual:\n$actual\nExpected:\n$expected\n""")
16: }
Actual:
This is a small
test file
Expected:
This is a small
test file
at munit.FunSuite.assert(FunSuite.scala:13)
at progscala3.forcomps.RemoveBlanksSuite.$init$$$anonfun$1(RemoveBlanksSuite.scala:15)
==> X progscala3.forcomps.RemoveBlanksSuite.RemoveBlanks optionally compresses whitespace in text 0.003s munit.FailException: src\test\scala\progscala3\forcomps\RemoveBlanksSuite.scala:24
23: |test file""".stripMargin
24: assert(actual == expected, s"""Actual:\n$actual\nExpected:\n$expected\n""")
25: }
Actual:
This is a small
test file
Expected:
This is a small
test file
Hmm. This passes for me. What OS are you using (e.g., MacOS, Windows, ...) and do you have a particular default language setting other than US English? For example, in my shell environment on MacOS, I have the environment variable definition: LANG=en_US.UTF-8.
I finished going through the scripts (which aren't tested as thoroughly). All are working when they should and when they are supposed to throw errors, those cases are flagged.
Hi Dean, the above failing tests were due to newlines in Windows OS. I've created a pull request that'll support Windows. I've also tested it on Mac OS and all tests are passing too.
Thanks so much!! Merged.
Let me know if you have any remaining issues. If not, I'll close this. No rush...
I'm going to close this, as it appears to be fixed...