Skip to content

Commit

Permalink
Add extra test and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Paul Wootten authored and Jeremy Paul Wootten committed Aug 23, 2023
1 parent 666807b commit 6de245a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/tests/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,22 @@ namespace Terminal.Test.Application {
option ("{'new-window':<false>}", "@a{sv} {}", () => {
var n_windows = (int) application.get_windows ().length ();
assert_cmpint (n_windows, CompareOperator.EQ, 1);
unowned var window = (MainWindow) application.active_window;
assert_nonnull (window);
var n_tabs = (int) window.terminals.length ();
assert_cmpint (n_tabs, CompareOperator.EQ, 1);
});
});

GLib.Test.add_func ("/application/command-line/execute", () => {
string[] execute = { "true", "echo test", "echo -e te\\tst", "false" };
string[] execute = { "true", "echo test", "echo -e te\\tst", "false" }; // 4 commands

// valid
option ("{'execute':<[b'%s']>}".printf (string.joinv ("',b'", execute)), "@a{sv} {}", () => {
unowned var window = (MainWindow) application.active_window;
assert_nonnull (window);
var n_tabs = (int) window.terminals.length ();
assert_cmpint (n_tabs, CompareOperator.EQ, 5); // include the guaranted extra tab
assert_cmpint (n_tabs, CompareOperator.EQ, 5); // Includes initial default tab added when no tabs restored.
});

// invalid
Expand Down

0 comments on commit 6de245a

Please sign in to comment.