fjdu_obsidian-latex-unicode/unicodeit/ts_src/tests.ts
2023-03-14 12:01:41 +08:00

31 lines
751 B
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { expect } from 'chai';
import { replace } from './replace';
describe('Symbols', () => {
describe('replace alpha', () => {
it('converts', done => {
expect(replace('\\alpha')).to.equal('α');
done();
});
});
describe('combining mark', () => {
it('adds dot to a', done => {
expect(replace('\\dot{a}')).to.equal('ȧ');
done();
});
it('adds dot to alpha', done => {
expect(replace('\\dot{\\alpha}')).to.equal('α̇');
done();
});
it('empty combining char', done => {
expect(replace('\\breve{}')).to.equal('˘');
done();
});
it('incomplete combining char', done => {
expect(replace('\\breve{')).to.equal('\\breve{');
done();
});
});
});