summaryrefslogtreecommitdiff
path: root/testsuite/tests/tool-toplevel/use_command.ml
blob: 7bb9d8fa2745ba4ce34c28fa1fe1b90f7673f17b (plain)
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
(* TEST
   * expect
*)

(* Test a success case *)
#use_output {|echo let x = 42|}
[%%expect {|
val x : int = 42
|}];;

(* When the command fails *)
#use_output {|false|}
[%%expect {|
Command exited with code 1.
|}];;

(* When the code is invalid *)
#use_output {|echo 1 :: x|}
[%%expect {|
File "(command-output)", line 1, characters 5-6:
1 | 1 :: x
         ^
Error: This expression has type int but an expression was expected of type
         int list
|}];;