Skip to content

Commit bd3cba2

Browse files
committed
test: is_wsl
1 parent 2b8f67d commit bd3cba2

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

+stdlib/is_wsl.m

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
end
2121
end
2222

23-
w = int32(w);
23+
mustBeInteger(w)
2424

2525
end
26-
27-
%!assert(class(is_wsl()), "int32")

test/TestSys.m

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
properties (TestParameter)
44
fun = {stdlib.iscygwin, stdlib.isoctave, stdlib.isinteractive, stdlib.has_dotnet, ...
55
stdlib.has_java, stdlib.has_python}
6-
fi32 = {stdlib.is_wsl}
76
end
87

98

@@ -13,10 +12,6 @@ function test_platform_logical(tc, fun)
1312
tc.verifyClass(fun, 'logical')
1413
end
1514

16-
function test_platform_int32(tc, fi32)
17-
tc.verifyClass(fi32, 'int32')
18-
end
19-
2015
function test_is_rosetta(tc)
2116
if ismac()
2217
tc.verifyClass(stdlib.is_rosetta(), 'logical')
@@ -25,6 +20,14 @@ function test_is_rosetta(tc)
2520
end
2621
end
2722

23+
function test_is_wsl(tc)
24+
if isunix() && ~ismac()
25+
tc.verifyGreaterThanOrEqual(stdlib.is_wsl(), 0)
26+
else
27+
tc.verifyEqual(stdlib.is_wsl(), 0)
28+
end
29+
end
30+
2831
function test_dotnet_version(tc)
2932
tc.assumeTrue(stdlib.has_dotnet())
3033
v = stdlib.dotnet_version();

0 commit comments

Comments
 (0)