gjtorikian / mathematical

Convert mathematical equations to SVGs, PNGs, or MathML. A general wrapper to Lasem and mtex2MML.
https://gjtorikian.github.io/mathematical/
MIT License
166 stars 31 forks source link

Nondeterministic failure with wrong equation number #124

Closed 4e554c4c closed 8 months ago

4e554c4c commented 8 months ago
$ SEED=21879 rake test
/home/pounce/.local/share/asdf/installs/ruby/3.1.1/bin/ruby -w -I"lib:test" /home/pounce/.local/share/asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/mathematical/basic_test.rb" "test/mathematical/corrections_test.rb" "test/mathematical/delimiters_test.rb" "test/mathematical/fixtures_test.rb" "test/mathematical/maliciousness_test.rb" "test/mathematical/mathjax_test.rb" "test/mathematical/mathml_test.rb" "test/mathematical/multiples_test.rb" "test/mathematical/performance_test.rb" "test/mathematical/png_test.rb" 
WARNING: Nokogiri was built against libxml version 2.11.6, but has dynamically loaded 2.12.1
Run options: --seed 21879

# Running:

.S..FFailed to parse mtex.............Line: 4022 Error: memory exhausted at token \sqrt
Failed to parse mtex.Line: 4022 Error: syntax error at token _
Failed to parse mtex..Line: 4022 Error: syntax error at token 
Failed to parse mtexFailed to create document...Size of latex string is greater than the maxsize..........................................................................................................................................................................................................S...............

Fabulous run in 2.701417s, 89.5826 runs/s, 1215.2882 assertions/s.

  1) Failure:
Mathematical::BasicTest#test_environments [/home/pounce/programming/mathematical/test/mathematical/delimiters_test.rb:59]:
--- expected
+++ actual
@@ -1 +1,3 @@
-"<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><semantics><mrow><mtable><mlabeledtr><mtd><mtext>(1)</mtext></mtd><mtd><mi>f</mi><mo stretchy=\"false\">(</mo><mi>x</mi><mo stretchy=\"false\">)</mo><mo>=</mo><mo stretchy=\"false\">(</mo><mi>x</mi><mo>+</mo><mi>a</mi><mo stretchy=\"false\">)</mo><mo stretchy=\"false\">(</mo><mi>x</mi><mo>+</mo><mi>b</mi><mo stretchy=\"false\">)</mo></mtd></mlabeledtr></mtable></mrow><annotation encoding='application/x-tex'></annotation></semantics></math>"
+# encoding: ASCII-8BIT
+#    valid: true
+"<math xmlns='http://www.w3.org/1998/Math/MathML' display='block'><semantics><mrow><mtable><mlabeledtr><mtd><mtext>(1001)</mtext></mtd><mtd><mi>f</mi><mo stretchy=\"false\">(</mo><mi>x</mi><mo stretchy=\"false\">)</mo><mo>=</mo><mo stretchy=\"false\">(</mo><mi>x</mi><mo>+</mo><mi>a</mi><mo stretchy=\"false\">)</mo><mo stretchy=\"false\">(</mo><mi>x</mi><mo>+</mo><mi>b</mi><mo stretchy=\"false\">)</mo></mtd></mlabeledtr></mtable></mrow><annotation encoding='application/x-tex'></annotation></semantics></math>"

242 runs, 3283 assertions, 1 failures, 0 errors, 2 skips

You have skipped tests. Run with --verbose for details.
  rake aborted!
Command failed with status (1): [ruby -w -I"lib:test" /home/pounce/.local/share/asdf/installs/ruby/3.1.1/lib/ruby/gems/3.1.0/gems/rake-13.1.0/lib/rake/rake_test_loader.rb "test/mathematical/basic_test.rb" "test/mathematical/corrections_test.rb" "test/mathematical/delimiters_test.rb" "test/mathematical/fixtures_test.rb" "test/mathematical/maliciousness_test.rb" "test/mathematical/mathjax_test.rb" "test/mathematical/mathml_test.rb" "test/mathematical/multiples_test.rb" "test/mathematical/performance_test.rb" "test/mathematical/png_test.rb" ]

Tasks: TOP => test
(See full trace by running task with --trace)