File: qtest.ml.ref

package info (click to toggle)
ocamlformat 0.28.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 14,436 kB
  • sloc: ml: 63,321; pascal: 4,769; lisp: 229; sh: 217; makefile: 121
file content (59 lines) | stat: -rw-r--r-- 1,030 bytes parent folder | download | duplicates (9)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
(*$T
  false
*)

(*$T foo
  foo  0 ( + ) [1;2;3] = 6  (* hehe *)
  foo  0 ( * ) [1;2;3] = 0  (* haha (*hoho *) *)
  foo  1 ( * ) [4;5]   = 20
  foo 12 ( + ) []      = 12
*)

(*$T foo
  foo 1 ( * ) [4;5] = foo 2 ( * ) [1;5;2]
*)

(*$= foo & ~printer:string_of_int
  (foo 1 ( * ) [4;5]) (foo 2 ( * ) [1;5;2])
*)

(*$Q foo
  Q.small_int (fun i-> foo i (+) [1;2;3] = List.fold_left (+) i [1;2;3])
  (Q.pair Q.small_int (Q.list Q.small_int)) (fun (i,l)-> foo i (+) l = List.fold_left (+) i l)
*)

(*$R foo
  let thing = foo  1 ( * )
  and li = [4;5] in
  assert_bool "something_witty" (thing li = 20);
   (* pertinent comment *)
  assert_bool "something_wittier" (1=1)
*)

(*$inject let brom = baz *)
(*$T brom
  brom.[2] = 'z'
*)

(*$T &
             1    = 2-1
            2+3 \
              = \
              \
              5
  
  1+1=2
*)

(*$T & 6 \
  & =
  2*3
*)

(*$Q & ~count:10
  (Q.small_int_corners ()) (fun n-> n+3 -2 -1 = abs n)
*)

(*$Q & ~max_gen:1000000 ~count:1000000
    (Q.make (fun _ -> ())) (fun () -> true)
*)