diff --git a/components/mjs/input/tex/extensions/braket/config.json b/components/mjs/input/tex/extensions/braket/config.json
index 6c565b4d3..b548fd447 100644
--- a/components/mjs/input/tex/extensions/braket/config.json
+++ b/components/mjs/input/tex/extensions/braket/config.json
@@ -6,13 +6,6 @@
"input/tex/braket"
]
},
- "copy": {
- "to": "[bundle]/input/tex/extensions/braket",
- "from": "[ts]/input/tex/braket",
- "copy": [
- "__locales__"
- ]
- },
"webpack": {
"name": "input/tex/extensions/braket",
"libs": [
diff --git a/components/mjs/input/tex/extensions/texhtml/config.json b/components/mjs/input/tex/extensions/texhtml/config.json
index f83300f1d..ec464a094 100644
--- a/components/mjs/input/tex/extensions/texhtml/config.json
+++ b/components/mjs/input/tex/extensions/texhtml/config.json
@@ -6,13 +6,6 @@
"input/tex/texhtml"
]
},
- "copy": {
- "to": "[bundle]/input/tex/extensions/texhtml",
- "from": "[ts]/input/tex/texhtml",
- "copy": [
- "__locales__"
- ]
- },
"webpack": {
"name": "input/tex/extensions/texhtml",
"libs": [
diff --git a/testsuite/tests/input/tex/Base.test.ts b/testsuite/tests/input/tex/Base.test.ts
index 6e06df5d7..ac6aa539c 100644
--- a/testsuite/tests/input/tex/Base.test.ts
+++ b/testsuite/tests/input/tex/Base.test.ts
@@ -255,7 +255,7 @@ describe('Error', () => {
});
it('Ampersand-error', () => {
- expectTexError('&').toBe('Misplaced &');
+ expectTexError('&').toBe("Misplaced '&'");
});
it('Argument-error', () => {
@@ -389,7 +389,7 @@ describe('Error', () => {
});
it('Misplaced Cr', () => {
- expectTexError('a\\cr b').toBe('Misplaced \\cr');
+ expectTexError('a\\cr b').toBe("Misplaced '\\cr'");
});
it('Dimension Error', () => {
@@ -461,7 +461,7 @@ describe('Error', () => {
});
it('Misplaced hline', () => {
- expectTexError('\\hline').toBe('Misplaced \\hline');
+ expectTexError('\\hline').toBe("Misplaced '\\hline'");
});
it('UnsupportedHFill', () => {
diff --git a/testsuite/tests/input/tex/Physics.test.ts b/testsuite/tests/input/tex/Physics.test.ts
index f95ea9cc5..7f0987202 100644
--- a/testsuite/tests/input/tex/Physics.test.ts
+++ b/testsuite/tests/input/tex/Physics.test.ts
@@ -2472,6 +2472,18 @@ describe('Physics Errors', () => {
it('InvalidNumber XMatrix m+', () => {
expectTexError('\\smqty(\\xmatrix{a}{2}{2.0})').toBe('Invalid number');
});
+
+ it('Missing Closing Delimiter', () => {
+ expect(
+ tex2mml('\\sin(1\\over2')
+ ).toMatchSnapshot();
+ });
+
+ it('Extra Open Delimiter', () => {
+ expect(
+ tex2mml('\\sin((1\\over2)')
+ ).toMatchSnapshot();
+ });
});
/**********************************************************************************/
diff --git a/testsuite/tests/input/tex/Tex.test.ts b/testsuite/tests/input/tex/Tex.test.ts
index a13a21551..a085b0bdf 100644
--- a/testsuite/tests/input/tex/Tex.test.ts
+++ b/testsuite/tests/input/tex/Tex.test.ts
@@ -24,6 +24,7 @@ import { HandlerType, ConfigurationType } from '#js/input/tex/HandlerTypes.js';
import { CommandMap } from '#js/input/tex/TokenMap.js';
import { Token } from '#js/input/tex/Token.js';
import { TagsFactory } from '#js/input/tex/Tags.js';
+import { texError } from '#js/input/tex/TexError.js';
import TexError from '#js/input/tex/TexError.js';
import {
ParseUtil,
@@ -138,26 +139,43 @@ describe('Tags', () => {
describe('TexError', () => {
test('Number argument', () => {
- const err = new TexError(null, 'test', 'Number: %1', 1 as any);
+ const err = new TexError('test', 'Number: %1', 1 as any);
expect(err.message).toBe('Number: 1');
});
test('Braced insertion', () => {
- const err = new TexError(null, 'test', 'Msg: %{1}, Number: %{2}', 'OK', 2 as any);
+ const err = new TexError('test', 'Msg: %{1}, Number: %{2}', 'OK', 2 as any);
expect(err.message).toBe('Msg: OK, Number: 2');
});
test.skip('Plural', () => {
- const err = new TexError(null, 'test', '%{plural:%1|abc}', 'apple');
+ const err = new TexError('test', '%{plural:%1|abc}', 'apple');
expect(err.message).toBe('%{plural:%1|abc}');
});
test('Percent', () => {
- const err = new TexError(null, 'test', '10%%');
+ const err = new TexError('test', '10%%');
expect(err.message).toBe('10%');
});
});
+describe('texError', () => {
+ test('Number argument', () => {
+ expect(() => texError(null, 'test', 'Number: %1', '1'))
+ .toThrow('Number: 1');
+ });
+
+ test('Braced insertion', () => {
+ expect(() => texError(null, 'test', 'Msg: %{1}, Number: %{2}', 'OK', '2'))
+ .toThrow('Msg: OK, Number: 2');
+ });
+
+ test('Percent', () => {
+ expect(() => texError(null, 'test', '10%%'))
+ .toThrow('10%');
+ });
+});
+
/**********************************************************************************/
setupComponents({
diff --git a/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap
index bc59e9aa3..66b32fe9e 100644
--- a/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap
+++ b/testsuite/tests/input/tex/__snapshots__/Base.test.ts.snap
@@ -3495,8 +3495,8 @@ exports[`Environments math 1`] = `
exports[`Error merror node 1`] = `
""
`;
diff --git a/testsuite/tests/input/tex/__snapshots__/Noerrors.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Noerrors.test.ts.snap
index 78b214274..2cf6cc091 100644
--- a/testsuite/tests/input/tex/__snapshots__/Noerrors.test.ts.snap
+++ b/testsuite/tests/input/tex/__snapshots__/Noerrors.test.ts.snap
@@ -2,7 +2,7 @@
exports[`NoError Ampersand-error 1`] = `
""
@@ -210,7 +210,7 @@ exports[`NoError Middle with Right 1`] = `
exports[`NoError Misplaced Cr 1`] = `
""
@@ -226,7 +226,7 @@ exports[`NoError Misplaced Move Root 1`] = `
exports[`NoError Misplaced hline 1`] = `
""
diff --git a/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap b/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap
index 218039580..e644e868f 100644
--- a/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap
+++ b/testsuite/tests/input/tex/__snapshots__/Physics.test.ts.snap
@@ -1154,6 +1154,22 @@ exports[`Options Italicdif true 1`] = `
"
`;
+exports[`Physics Errors Extra Open Delimiter 1`] = `
+""
+`;
+
+exports[`Physics Errors Missing Closing Delimiter 1`] = `
+""
+`;
+
exports[`Physics1_0 Quantities_Quantities_0 1`] = `
"