Skip to content

Commit

Permalink
Merge pull request #226 from NetsBlox/matlab-logical-types
Browse files Browse the repository at this point in the history
Convert to true/false not 1/0 when logical mwtype (matlab service)
  • Loading branch information
brollb authored Mar 4, 2024
2 parents b12bb5d + ea6b980 commit 0fe9474
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/procedures/matlab/matlab.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ MATLAB._parseArgument = function (arg) {
const mwdata = flatValues
.map((v) => {
if (mwtype === "logical") {
return v ? 1 : 0;
return v ? true : false;
} else if (mwtype === "string") {
return v.toString();
} else { // number
Expand Down
2 changes: 1 addition & 1 deletion test/procedures/matlab/matlab.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ describe(utils.suiteName(__filename), function () {
it("should coerce booleans to 1/0", function () {
const example = [true, false];
const actual = MATLAB._parseArgument(example);
const expected = [1, 0];
const expected = [true, false];
assert.deepEqual(actual.mwdata, expected);
});

Expand Down

0 comments on commit 0fe9474

Please sign in to comment.