Skip to content

Commit 86115a0

Browse files
committed
test: is_cygwin
1 parent bd3cba2 commit 86115a0

File tree

3 files changed

+21
-18
lines changed

3 files changed

+21
-18
lines changed

+stdlib/is_cygwin.m

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
%% IS_CYGWIN Detect if running under Cygwin
2+
3+
function y = is_cygwin()
4+
5+
y = false;
6+
7+
if isunix() && ~ismac()
8+
fid = fopen('/proc/version');
9+
if fid > 0
10+
v = fscanf(fid,'%s');
11+
fclose(fid);
12+
y = ~isempty(strfind(v, 'CYGWIN')); %#ok<STREMP>
13+
end
14+
end
15+
16+
end

+stdlib/iscygwin.m

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/TestSys.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
classdef TestSys < matlab.unittest.TestCase
22

33
properties (TestParameter)
4-
fun = {stdlib.iscygwin, stdlib.isoctave, stdlib.isinteractive, stdlib.has_dotnet, ...
4+
fun = {stdlib.isoctave, stdlib.isinteractive, stdlib.has_dotnet, ...
55
stdlib.has_java, stdlib.has_python}
66
end
77

@@ -12,6 +12,10 @@ function test_platform_logical(tc, fun)
1212
tc.verifyClass(fun, 'logical')
1313
end
1414

15+
function test_is_cygwin(tc)
16+
tc.verifyFalse(stdlib.is_cygwin())
17+
end
18+
1519
function test_is_rosetta(tc)
1620
if ismac()
1721
tc.verifyClass(stdlib.is_rosetta(), 'logical')

0 commit comments

Comments
 (0)