From cc914e5a7b410ec4e73bde9d684c696ac450e62d Mon Sep 17 00:00:00 2001 From: Goswin Rothenthal Date: Wed, 18 Sep 2024 20:29:36 +0200 Subject: [PATCH] fix tests --- build.sh | 2 -- tests/Js/Main/StringTests.fs | 18 ++++++++---------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/build.sh b/build.sh index 31bbad200e..807a756d27 100755 --- a/build.sh +++ b/build.sh @@ -2,5 +2,3 @@ dotnet tool restore dotnet run --project src/Fable.Build/Fable.Build.fsproj -- $@ -# dotnet run --project src/Fable.Build/Fable.Build.fsproj -- test javascript -# dotnet run --project src/Fable.Build/Fable.Build.fsproj -- test typescript diff --git a/tests/Js/Main/StringTests.fs b/tests/Js/Main/StringTests.fs index 8a598c5a7c..3707d3a483 100644 --- a/tests/Js/Main/StringTests.fs +++ b/tests/Js/Main/StringTests.fs @@ -815,30 +815,28 @@ let tests = testList "Strings" [ "abcdbcebc".IndexOfAny([|'c';'b'|]) |> equal 1 testCase "String.StartsWith works" <| fun () -> - let args = [("ab", true); ("cd", false); ("abcdx", false)] + let args = [("ab", true); ("bc", false); ("cd", false); ("abcdx", false); ("abcd", true)] for arg in args do "abcd".StartsWith(fst arg) |> equal (snd arg) - testCase "String.StartsWith with StringComparison.OrdinalIgnoreCase works" <| fun () -> - let args = [("ab", true); ("AB", true); ("cd", false); ("abcd", false)] + testCase "String.StartsWith with OrdinalIgnoreCase works" <| fun () -> + let args = [("ab", true); ("AB", true); ("BC", false); ("cd", false); ("abcdx", false); ("abcd", true)] for arg in args do "ABCD".StartsWith(fst arg, StringComparison.OrdinalIgnoreCase) |> equal (snd arg) - testCase "String.EndsWith works" <| fun () -> - let args = [("ab", false); ("cd", true); ("abcdx", false)] + let args = [("ab", false); ("cd", true); ("bc", false); ("abcdx", false); ("abcd", true)] for arg in args do "abcd".EndsWith(fst arg) |> equal (snd arg) - - testCase "String.EndsWith with StringComparison.OrdinalIgnoreCase works" <| fun () -> - let args = [("ab", false); ("CD", true); ("cd", true); ("abcd", false)] + + testCase "String.EndsWith with OrdinalIgnoreCase works" <| fun () -> + let args = [("ab", false); ("CD", true); ("cd", true); ("bc", false); ("xabcd", false); ("abcd", true)] for arg in args do "ABCD".EndsWith(fst arg, StringComparison.OrdinalIgnoreCase) - |> equal (snd arg) - + |> equal (snd arg) testCase "String.Trim works" <| fun () -> " abc ".Trim()