v2 / vlib / v / debug / tests / option.expect
35 lines · 30 sloc · 778 bytes · 135e2f1cc6dd281dba85dd34b99c22d60bd4270e
Raw
1#!/usr/bin/env expect
2source "common.tcl"
3
4expect "Break on *main* test in ${test_file}:8\r\n"
5expect "${test_file}:8 vdbg> "
6send "p f\n"
7expect "f = Test(Test2{}) (main.Test)"
8expect "${test_file}:8 vdbg> "
9send "p t\n"
10expect "t = Option(Test(Test2{})) (?main.Test)"
11expect "${test_file}:8 vdbg> "
12send "c\n"
13
14expect "${test_file}:16 vdbg> "
15send "p a\n"
16expect "a = Option(none) (?int)"
17expect "${test_file}:16 vdbg> "
18send "c\n"
19
20expect "${test_file}:16 vdbg> "
21send "p a\n"
22expect "a = Option(1) (?int)"
23expect "${test_file}:16 vdbg> "
24send "c\n"
25
26expect "${test_file}:12 vdbg> "
27send "p f\n"
28expect "f = Test(Test2{}) (main.Test)"
29expect "${test_file}:12 vdbg> "
30send "p t\n"
31expect "t = Option(none) (?&main.Test)"
32
33expect "${test_file}:12 vdbg> "
34send "q\n"
35expect eof
36