I am trying to investigate the fsharp repo to find similar CultureInfo problems to this PR. However, when trying to run test.ps1 on Windows OS with PowerShell 7.4.4 to verifying the examplar, I run into these issues.
test.ps1seems to first look at refactoring projects (tree-building, ledger and markdown). The scripts fails at ledger because of the inconsistency when usingSystem.Environment.NewLineon the test but use\non the main exercise. This fails because I use Windows which defaults to\r\n. Should I change them all to\n? The C# ledger exercise only uses\n.- After fixing that,
test.ps1replaces exercise with examplar but it fails at protein-translation project with
Move-Item: E:\code\CSharpCode\Exercism\fsharp\test.ps1:67
Line |
67 | Move-Item -Path $example -Destination $stub -Force
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Cannot find path
| 'E:\code\CSharpCode\Exercism\fsharp\build\practice\protein-translation\.articles\performance\code\.meta\Example.fs' because it does not exist.
- I think it is because the protein-translation project has an extra project
Benchmark.fsprojinside it and the script cannot find anExamplar.fsnear it. I have added a condition check to bypass it but I wonder how this error doesn’t happen on the server? - F# ledger exercise uses
new CultureInfo(string)a lot. I try changing it tonew CultureInfo(string, false)but doing this fails 7/10 tests. Through more research, I find out that F# examplar do not take into accountCultureInfo.NumberFormat.CurrencyNegativePatternand just roll with the default currency negative pattern fromnew CultureInfo(string). On the other hand, the C# examplar does set the currency negative pattern. I suggest changing the F# examplar to be similar to the C# one. I wonder how this passes the test on the server though. Do the server have a custom setting for “en-US” currency negative pattern?
About the CultureInfo issue on other exercises, there seem to be no more problems because F# test uses the [UseCulture] attribute from Exercism.Tests package, which uses new CultureInfo(string, false).