diff --git a/testsuite/tests/input/tex/Newcommand.test.ts b/testsuite/tests/input/tex/Newcommand.test.ts
index edb1c04a2..9347b0ac2 100644
--- a/testsuite/tests/input/tex/Newcommand.test.ts
+++ b/testsuite/tests/input/tex/Newcommand.test.ts
@@ -222,6 +222,21 @@ describe('Newcommand', () => {
tex2mml('\\def\\x#1{\\def\\y##1#1{[##1]}\\y} \\x\\X abc \\X')
).toMatchSnapshot();
});
+
+ it('Def insignificant spaces', () => {
+ expect(tex2mml('\\def\\x #1 {[#1]} \\x{x}')).toMatchSnapshot();
+ });
+
+ it('Def significant spaces 1', () => {
+ expectTexError('\\def\\x#1 #2{[#1,#2]} \\x{a}{b}').toBe('Runaway argument for \\x?');
+ expect(tex2mml('\\def\\x#1 #2{[#1,#2]} \\x{a} {b}')).toMatchSnapshot();
+ });
+
+ it('Def significant spaces 2', () => {
+ expectTexError('\\def\\x#1 #2 {[#1,#2]} \\x{a}{b}').toBe('Runaway argument for \\x?');
+ expectTexError('\\def\\x#1 #2 {[#1,#2]} \\x{a} {b}').toBe('Runaway argument for \\x?');
+ expect(tex2mml('\\def\\x#1 #2{[#1,#2]} \\x{a} {b} ')).toMatchSnapshot();
+ });
});
/**********************************************************************************/
diff --git a/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap
index 35f2f7978..a0b254542 100644
--- a/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap
+++ b/testsuite/tests/input/tex/__snapshots__/Newcommand.test.ts.snap
@@ -327,6 +327,34 @@ exports[`Newcommand Def Template Matching 1`] = `
"
`;
+exports[`Newcommand Def insignificant spaces 1`] = `
+""
+`;
+
+exports[`Newcommand Def significant spaces 1 1`] = `
+""
+`;
+
+exports[`Newcommand Def significant spaces 2 1`] = `
+""
+`;
+
exports[`Newcommand Let Angle Circular 1`] = `
"