mathjax / MathJax-node

MathJax for Node
Apache License 2.0
614 stars 96 forks source link

Missing backslash in test coverage #437

Open taurgal opened 5 years ago

taurgal commented 5 years ago

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.

pkra commented 5 years ago

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.

dpvc commented 5 years ago

test is ok as is, I think

I agree.