MathJax-node icon indicating copy to clipboard operation
MathJax-node copied to clipboard

Missing backslash in test coverage

Open taurgal opened this issue 5 years ago • 2 comments

The asset file test/assets/test.js for the test test/config-third-party-extensions.js is missing a backslash. Indeed the file is

MathJax.Hub.Register.StartupHook("TeX Jax Ready", function () {
  MathJax.InputJax.TeX.Definitions.Add({
    macros: {
      test: ["Macro", "\text{This is a Test}"]
    }
  });
});

MathJax.Ajax.loadComplete("[test]/test.js");

When it should be (\text -> \\text line 4):

MathJax.Hub.Register.StartupHook("TeX Jax Ready", function () {
  MathJax.InputJax.TeX.Definitions.Add({
    macros: {
      test: ["Macro", "\\text{This is a Test}"]
    }
  });
});

MathJax.Ajax.loadComplete("[test]/test.js");

This shows that error checking is not enough for mathjax-node test covering: probably one should compare data.mml and/or data.html to the expected values and not merely check data.errors.

taurgal avatar Mar 18 '19 11:03 taurgal

When it should be (\text -> \text line 4):

True.

This shows that error checking is not enough for mathjax-node test covering: probably one should compare data.mml and/or data.html to the expected values and not merely check data.errors.

I disagree. We don't test the behavior of the macro but the loading of an extension. In other words, the point of the test is that the macro can be used at all (as opposed to throwing an "unknown macro" error).

So fixing this typo would be nice but the test is ok as is, I think.

pkra avatar Mar 18 '19 12:03 pkra

test is ok as is, I think

I agree.

dpvc avatar Mar 18 '19 14:03 dpvc