Skip to content

Commit cfa23b0

Browse files
committed
Add swath of tests to workflow
1 parent 1ebcb2a commit cfa23b0

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

.github/workflows/bat.yml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,50 @@ jobs:
1818
env:
1919
MATHWORKS_TOKEN: ${{ secrets.MATHWORKS_TOKEN }}
2020

21-
- name: Exercise RunMATLABCommand
21+
- name: Greet the world in style
2222
uses: ./
2323
with:
2424
command: "disp('hello world');"
25+
26+
- name: Run MATLAB statement
27+
uses: ./
28+
with:
29+
command: f = fopen('myscript.m', 'w'); fwrite(f, 'assert(true)'); fclose(f);
30+
31+
- name: Run MATLAB script
32+
uses: ./
33+
with:
34+
command: myscript
35+
36+
- name: Run MATLAB statement with quotes 1
37+
uses: ./
38+
with:
39+
command: "eval(\"a = 1+2\"); assert(a == 3); eval('b = 3+4'); assert(b == 7);"
40+
41+
- name: Run MATLAB statement with quotes 2
42+
uses: ./
43+
with:
44+
command: 'eval("a = 1+2"); assert(a == 3); eval(''b = 3+4''); assert(b == 7);'
45+
46+
- name: Run MATLAB statement with quotes 3
47+
uses: ./
48+
with:
49+
command: a = """hello world"""; b = '"hello world"'; assert(strcmp(a,b));
50+
51+
- name: Run MATLAB statement with symbols
52+
uses: ./
53+
with:
54+
command: a = " !""#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; b = char([32:126]); assert(strcmp(a, b), a+b);
55+
56+
- name: Run MATLAB statement in working directory
57+
uses: ./
58+
with:
59+
command: exp = getenv('SYSTEM_DEFAULTWORKINGDIRECTORY'); act = pwd; assert(strcmp(act, exp), strjoin({act exp}, '\n'));
60+
61+
- run: echo 'onetyone = 11' > startup.m
62+
shell: bash
63+
64+
- name: MATLAB runs startup.m automatically
65+
uses: ./
66+
with:
67+
command: assert(onetyone==11, 'the variable `onetyone` was not set as expected by startup.m')

0 commit comments

Comments
 (0)