Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
goswinr committed Sep 18, 2024
1 parent 72fe819 commit cc914e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
2 changes: 0 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 8 additions & 10 deletions tests/Js/Main/StringTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit cc914e5

Please sign in to comment.