Skip to content

Commit

Permalink
tests: make matrix units positional
Browse files Browse the repository at this point in the history
Ensures that matrix indexing is correct for dimensional analysis pass
  • Loading branch information
mgreminger authored Oct 24, 2024
1 parent 70da33e commit e2bd714
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/test_matrix_indexing.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ test('Nonnumeric index', async () => {
});

test('Indexing with expression', async () => {
await page.setLatex(0, String.raw`A=\begin{bmatrix}1\\ 2\\ 3\end{bmatrix}\cdot1\left\lbrack m\right\rbrack`);
await page.setLatex(0, String.raw`A=\begin{bmatrix}1\left\lbrack m\right\rbrack\\ 2\left\lbrack s\right\rbrack\\ 3\left\lbrack kg\right\rbrack\end{bmatrix}`);

await page.locator('#add-math-cell').click();
await page.setLatex(1, String.raw`A_{\mathrm{count}\left(A\right),1}=`);
Expand All @@ -136,12 +136,12 @@ test('Indexing with expression', async () => {
let content = await page.textContent(`#result-value-1`);
expect(parseLatexFloat(content)).toBeCloseTo(3, precision);
content = await page.textContent('#result-units-1');
expect(content).toBe('m');
expect(content).toBe('kg');

content = await page.textContent(`#result-value-2`);
expect(parseLatexFloat(content)).toBeCloseTo(2, precision);
content = await page.textContent('#result-units-2');
expect(content).toBe('m');
expect(content).toBe('s');

content = await page.textContent(`#result-value-3`);
expect(parseLatexFloat(content)).toBeCloseTo(1, precision);
Expand Down

0 comments on commit e2bd714

Please sign in to comment.