File: string_.ml

package info (click to toggle)
ocaml-luv 0.5.14-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,504 kB
  • sloc: ml: 11,130; makefile: 6,223; sh: 4,592; ansic: 1,517; python: 38
file content (28 lines) | stat: -rw-r--r-- 797 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
(* This file is part of Luv, released under the MIT license. See LICENSE.md for
   details, or visit https://github.com/aantron/luv/blob/master/LICENSE.md. *)



let tests = [
  "string", [
    "utf16_length_as_wtf8", `Quick, begin fun () ->
      Luv.String.utf16_length_as_wtf8 "f\x00\xBB\x03"
      |> Alcotest.(check int) "length" 3
    end;

    "utf16_to_wtf8", `Quick, begin fun () ->
      Luv.String.utf16_to_wtf8 "f\x00\xBB\x03"
      |> Alcotest.(check string) "value" "fλ"
    end;

    "wtf8_length_as_utf16", `Quick, begin fun () ->
      Luv.String.wtf8_length_as_utf16 "fλ"
      |> Alcotest.(check int) "length" 3
    end;

    "wtf8_to_utf16", `Quick, begin fun () ->
      Luv.String.wtf8_to_utf16 "fλ"
      |> Alcotest.(check string) "value" "f\x00\xBB\x03"
    end;
  ]
]