From 3d33d61f03ba90aaf9a15ec5dcd0e993ff46559c Mon Sep 17 00:00:00 2001 From: Alexandre Nunes Date: Tue, 15 Sep 2020 12:03:22 -0300 Subject: [PATCH] test: implement hat operator use cases --- __test__/index.test.ts | 50 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/__test__/index.test.ts b/__test__/index.test.ts index 1e26026..96c9710 100755 --- a/__test__/index.test.ts +++ b/__test__/index.test.ts @@ -1108,6 +1108,56 @@ describe('#convert', () => { }); }); + describe('where its first child is a mrow and second is mo containing hat mo as utf-8', () => { + test('wrap it content inside hat command', () => { + const mathml = ` + + + + + x + + + y + + + z + + ^ + + + + `; + + const result = MathMLToLaTeX.convert(mathml); + + expect(result).toBe('\\hat{x + y + z}'); + }); + }); + + describe('where its first child is a mrow and second is mo containing hat mo as encoded', () => { + test('wrap it content inside hat command', () => { + const mathml = ` + + + + + x + + + y + + + z + + ˆ + + + + `; + + const result = MathMLToLaTeX.convert(mathml); + + expect(result).toBe('\\hat{x + y + z}'); + }); + }); + describe('where its first child is a mrow and second is mo containing generic char', () => { test('wrap it content inside overset making generic char on top', () => { const mathml = `