Skip to content

Commit

Permalink
add string-test.satyg
Browse files Browse the repository at this point in the history
  • Loading branch information
gfngfn committed Oct 28, 2024
1 parent be66985 commit 0cf8d1a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions lib-satysfi/packages/stdlib/stdlib.0.0.1/test/string-test.satyg
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
use package open Testing
use String
use List

module StringTest = struct

#[test]
val chop-prefix-test () =
List.iter (fun r ->
assert-equal ?(title = r#title) Equality.(option string)
r#expected
(String.chop-prefix r#prefix r#data)
) [
(|
title = `removes a prefix (1)`,
prefix = `foo`,
data = `foobar`,
expected = Some(`bar`),
|),
(|
title = `removes a prefix (2)`,
prefix = `foo`,
data = `foo`,
expected = Some(` `),
|),
(|
title = `fail`,
prefix = `foo`,
data = `fob`,
expected = None,
|),
]

end

0 comments on commit 0cf8d1a

Please sign in to comment.