@@ -33,79 +33,79 @@ struct TestShell
33
33
};
34
34
} // namespace
35
35
36
- TEST_CASE (" shell.syntax.exit" )
37
- {
38
- TestShell shell;
39
- CHECK (shell (" exit" ).exitCode == 0 );
40
- CHECK (shell (" exit 1" ).exitCode == 1 );
41
- CHECK (shell (" exit 123" ).exitCode == 123 );
42
- }
43
-
44
- TEST_CASE (" shell.syntax.if" )
45
- {
46
- TestShell shell;
47
- CHECK (shell (" if true; then exit 2; else exit 3; fi" ).exitCode == 2 );
48
- CHECK (shell (" if false; then exit 2; else exit 3; fi" ).exitCode == 3 );
49
- }
50
-
51
- TEST_CASE (" shell.syntax.pipes" )
52
- {
53
- CHECK (escape (TestShell ()(" echo hello | grep ll" ).output ()) == escape (" hello\n " ));
54
- CHECK (escape (TestShell ()(" echo hello | grep ll | grep hell" ).output ()) == escape (" hello\n " ));
55
- }
56
-
57
- TEST_CASE (" shell.builtin.read.DefaultVar" )
58
- {
59
- auto const input = " hello world" s;
60
- TestShell shell;
61
- shell.pty .writeToStdin (input + " \n " s);
62
- shell (" read" );
63
- CHECK (shell.env .get (" REPLY" ).value_or (" NONE" ) == input);
64
- }
36
+ // TEST_CASE("shell.syntax.exit")
37
+ // {
38
+ // TestShell shell;
39
+ // CHECK(shell("exit").exitCode == 0);
40
+ // CHECK(shell("exit 1").exitCode == 1);
41
+ // CHECK(shell("exit 123").exitCode == 123);
42
+ // }
65
43
66
- TEST_CASE (" shell.builtin.read.CustomVar" )
67
- {
68
- auto const input = " hello world" s;
69
- TestShell shell;
70
- shell.pty .writeToStdin (input + " \n " s);
71
- shell (" read BRU" );
72
- CHECK (shell.env .get (" BRU" ).value_or (" NONE" ) == input);
73
- }
44
+ // TEST_CASE("shell.syntax.if")
45
+ // {
46
+ // TestShell shell;
47
+ // CHECK(shell("if true; then exit 2; else exit 3; fi").exitCode == 2);
48
+ // CHECK(shell("if false; then exit 2; else exit 3; fi").exitCode == 3);
49
+ // }
74
50
75
- TEST_CASE (" shell.builtin.set_variable" )
76
- {
77
- TestShell shell;
78
- shell (" set BRU hello" );
79
- CHECK (shell.env .get (" BRU" ).value_or (" NONE" ) == " hello" );
80
- }
51
+ // TEST_CASE("shell.syntax.pipes")
52
+ // {
53
+ // CHECK(escape(TestShell()("echo hello | grep ll").output()) == escape("hello\n"));
54
+ // CHECK(escape(TestShell()("echo hello | grep ll | grep hell").output()) == escape("hello\n"));
55
+ // }
81
56
82
- TEST_CASE (" shell.builtin.get_variable" )
83
- {
84
- TestShell shell;
85
- shell (" set BRU hello" );
86
- CHECK (shell.env .get (" BRU" ).value_or (" NONE" ) == " hello" );
87
- shell (" $BRU" );
88
- }
57
+ // TEST_CASE("shell.builtin.read.DefaultVar")
58
+ // {
59
+ // auto const input = "hello world"s;
60
+ // TestShell shell;
61
+ // shell.pty.writeToStdin(input + "\n"s);
62
+ // shell("read");
63
+ // CHECK(shell.env.get("REPLY").value_or("NONE") == input);
64
+ // }
89
65
90
- TEST_CASE (" shell.builtin.get_variable_inside_curl_brackets" )
91
- {
92
- TestShell shell;
93
- shell (" set BRU hello" );
94
- CHECK (shell.env .get (" BRU" ).value_or (" NONE" ) == " hello" );
95
- shell (" ${BRU}" );
96
- }
66
+ // TEST_CASE("shell.builtin.read.CustomVar")
67
+ // {
68
+ // auto const input = "hello world"s;
69
+ // TestShell shell;
70
+ // shell.pty.writeToStdin(input + "\n"s);
71
+ // shell("read BRU");
72
+ // CHECK(shell.env.get("BRU").value_or("NONE") == input);
73
+ // }
97
74
75
+ // TEST_CASE("shell.builtin.set_variable")
76
+ // {
77
+ // TestShell shell;
78
+ // shell("set BRU hello");
79
+ // CHECK(shell.env.get("BRU").value_or("NONE") == "hello");
80
+ // }
98
81
99
- // TEST_CASE("shell.builtin.set_and_export_variable ")
82
+ // TEST_CASE("shell.builtin.get_variable ")
100
83
// {
101
84
// TestShell shell;
102
85
// shell("set BRU hello");
103
86
// CHECK(shell.env.get("BRU").value_or("NONE") == "hello");
87
+ // shell("$BRU");
88
+ // }
104
89
105
- // shell("export $BRU");
106
- // CHECK(shell("echo $BRU").output() == "hello\n");
90
+ // TEST_CASE("shell.builtin.get_variable_inside_curl_brackets")
91
+ // {
92
+ // TestShell shell;
93
+ // shell("set BRU hello");
94
+ // CHECK(shell.env.get("BRU").value_or("NONE") == "hello");
95
+ // shell("${BRU}");
107
96
// }
108
97
98
+
99
+ TEST_CASE (" shell.builtin.set_and_export_variable" )
100
+ {
101
+ TestShell shell;
102
+ shell (" set BRU hello" );
103
+ CHECK (shell.env .get (" BRU" ).value_or (" NONE" ) == " hello" );
104
+
105
+ shell (" export $BRU" );
106
+ CHECK (shell (" echo $BRU" ).output () == " hello\n " );
107
+ }
108
+
109
109
// TEST_CASE("shell.builtin.read.prompt") TODO
110
110
// {
111
111
// TestShell shell;
0 commit comments