Skip to content

Commit

Permalink
test:subprocess: use assert on status
Browse files Browse the repository at this point in the history
  • Loading branch information
scivision committed Jul 9, 2024
1 parent 347de22 commit ea52f8a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions test/TestSubprocess.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function test_simple_run(tc)
end

[status, msg, err] = stdlib.subprocess_run(c);
tc.verifyEqual(status, 0)
tc.verifyTrue(strlength(msg) > 0)
tc.verifyTrue(strlength(err) == 0)
tc.assertEqual(status, 0, err)
tc.verifyGreaterThan(strlength(msg), 0)
tc.verifyEqual(strlength(err), 0)

end

Expand All @@ -40,14 +40,14 @@ function test_cwd(tc)
td = fixture.Folder;

[s, m, e] = stdlib.subprocess_run(c);
tc.verifyEqual(s, 0)
tc.verifyTrue(strlength(m) > 0)
tc.verifyTrue(strlength(e) == 0)

[s, mc, e] = stdlib.subprocess_run(c, "cwd", td);
tc.verifyEqual(s, 0)
tc.verifyNotEqual(m, mc)
tc.verifyTrue(strlength(e) == 0)
tc.assertEqual(s, 0, "status non-zero")
tc.verifyGreaterThan(strlength(m), 0, "empty directory not expected")
tc.verifyEqual(strlength(e), 0, e)

[s, mc, e] = stdlib.subprocess_run(c, cwd=td);
tc.assertEqual(s, 0, "status non-zero")
tc.verifyNotEqual(m, mc, "expected different directory to have different contents")
tc.verifyEqual(strlength(e), 0, e)

end

Expand Down

0 comments on commit ea52f8a

Please sign in to comment.