Skip to content

Commit 6791367

Browse files
committed
add self-tests for new functions
1 parent 6406376 commit 6791367

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/TestFileImpure.m

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,35 @@ function test_username(tc)
299299

300300
end
301301

302+
function test_hostname(tc)
303+
h = stdlib.hostname();
304+
L = strlength(h);
305+
tc.verifyGreaterThan(L, 0, "expected non-empty hostname")
306+
307+
end
308+
309+
function test_getpid(tc)
310+
pid = stdlib.getpid();
311+
tc.verifyGreaterThan(pid, 0, "expected positive PID")
312+
end
313+
314+
function test_get_permissions(tc)
315+
import matlab.unittest.constraints.StartsWithSubstring
316+
p = stdlib.get_permissions(".");
317+
tc.verifyThat(p, StartsWithSubstring("r"))
318+
end
319+
320+
function test_java_version(tc)
321+
v = stdlib.java_version();
322+
L = strlength(v);
323+
tc.verifyGreaterThanOrEqual(L, 4)
324+
end
325+
326+
function test_java_api(tc)
327+
v = stdlib.java_api();
328+
tc.verifyGreaterThanOrEqual(v, 8)
329+
end
330+
302331
end
303332

304333
end

0 commit comments

Comments
 (0)