Skip to content

Commit

Permalink
safe-string: make BatBytes safe
Browse files Browse the repository at this point in the history
  • Loading branch information
gasche committed Sep 23, 2017
1 parent ea80aa7 commit f788c75
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/batBytes.mlv
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ include Bytes
##V<4.3##let lowercase_ascii s = map BatChar.lowercase_ascii s

(*$T uppercase_ascii
equal ("five" |> of_string |> uppercase_ascii |> to_string) "FIVE"
equal ("école" |> of_string |> uppercase_ascii |> to_string) "éCOLE"
String.equal ("five" |> of_string |> uppercase_ascii |> to_string) "FIVE"
String.equal ("école" |> of_string |> uppercase_ascii |> to_string) "éCOLE"
*)

(*$T lowercase_ascii
equal ("FIVE" |> of_string |> lowercase_ascii |> to_string) "five"
equal ("ÉCOLE" |> of_string |> lowercase_ascii |> to_string) "École"
String.equal ("FIVE" |> of_string |> lowercase_ascii |> to_string) "five"
String.equal ("ÉCOLE" |> of_string |> lowercase_ascii |> to_string) "École"
*)

##V<4.3##let map_first_char f s =
Expand All @@ -66,13 +66,13 @@ include Bytes
##V<4.3##let uncapitalize_ascii s = map_first_char BatChar.lowercase_ascii s

(*$T capitalize_ascii
equal ("five" |> of_string |> capitalize_ascii |> to_string) "Five"
equal ("école" |> of_string |> capitalize_ascii |> to_string) "école"
String.equal ("five" |> of_string |> capitalize_ascii |> to_string) "Five"
String.equal ("école" |> of_string |> capitalize_ascii |> to_string) "école"
*)

(*$T uncapitalize_ascii
equal ("Five" |> of_string |> uncapitalize_ascii |> to_string) "five"
equal ("École" |> of_string |> uncapitalize_ascii |> to_string) "École"
String.equal ("Five" |> of_string |> uncapitalize_ascii |> to_string) "five"
String.equal ("École" |> of_string |> uncapitalize_ascii |> to_string) "École"
*)


Expand Down

0 comments on commit f788c75

Please sign in to comment.