Skip to content

Commit bc14c58

Browse files
authored
Merge pull request #2 from matlab-actions/jpereira/integ-test
Add integration tests
2 parents 1ebcb2a + 1e72842 commit bc14c58

File tree

3 files changed

+46
-3
lines changed

3 files changed

+46
-3
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('GITHUB_WORKSPACE'), 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')

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "run-matlab-command-action",
33
"author": "The MathWorks, Inc.",
4-
"version": "0.2.0",
4+
"version": "0.2.1",
55
"description": "",
66
"main": "lib/index.js",
77
"scripts": {

0 commit comments

Comments
 (0)