Debian Codegraph @

test/blob_stability_tests.ml

raw symbols SCIP
1 open! Core
2 open! Import
3
4 let run_test = Blob_tests.run_stability_test
5
6 (* WARNING: never accept the corrected output for this test, it must never change! *)
7 let%expect_test "" =
8 run_test Int.Stable.V1.bin_t Int.equal 12;
9 [%expect
10 {|
11 bin dump : \012
12 bin dump (blob) : \001\000\000\000\000\000\000\000\012
13 bin dump as opaque big string and string are the same? true
14 |}];
15 run_test String.Stable.V1.bin_t String.equal "Testing string";
16 [%expect
17 {|
18 bin dump : \014Testing string
19 bin dump (blob) : \015\000\000\000\000\000\000\000\014Testing string
20 bin dump as opaque big string and string are the same? true
21 |}];
22 run_test Float_with_finite_only_serialization.Stable.V1.bin_t Float.equal 1.234;
23 [%expect
24 {|
25 bin dump : X9\180\200v\190\243?
26 bin dump (blob) : \b\000\000\000\000\000\000\000X9\180\200v\190\243?
27 bin dump as opaque big string and string are the same? true
28 |}];
29 run_test
30 Host_and_port.Stable.V1.bin_t
31 Host_and_port.equal
32 (Host_and_port.create ~host:"testhost" ~port:123);
33 [%expect
34 {|
35 bin dump : \btesthost{
36 bin dump (blob) : \n\000\000\000\000\000\000\000\btesthost{
37 bin dump as opaque big string and string are the same? true
38 |}];
39 run_test (bin_list Int.Stable.V1.bin_t) (List.equal Int.equal) [ 1; 3; 1; 5 ];
40 [%expect
41 {|
42 bin dump : \004\001\003\001\005
43 bin dump (blob) : \005\000\000\000\000\000\000\000\004\001\003\001\005
44 bin dump as opaque big string and string are the same? true
45 |}]
46 ;;