Commit graph

70 commits

Author SHA1 Message Date
Stegmujo 6ffaed440c
Remove additional mi for Hbox cases in TexUtilTest
* fix results for tests
* testindices 53 to 58
* formerly this contained a comparator fix (rolled back)

Bug: T327392
Change-Id: I1af65d5d8a4625d164630254da285830f4c9e0a3
2023-02-16 20:25:48 +01:00
Stegmujo 14c38c8f46
Fix vline in Matrix in TexUtilTest
* case index 654

Bug: T327392
Change-Id: I3f7d22ff501a30eef79baf82236406d8f5e450ae
2023-02-16 17:16:19 +01:00
jenkins-bot d6de86cba3 Merge "Allow \circ command in bonds in TexVCPHP" 2023-02-16 09:03:23 +00:00
Stegmujo bcc066de21 Fix GenerationParserTest for texvctreebugs check
* fix the testfile so it can be read correctly for texvctreebugs category
* fix the test that category can be selected dynamically

Bug: T327391

Change-Id: I51508bddb83ba925c739962df41c04f1ccfd311b
2023-02-15 14:07:05 +00:00
Stegmujo 65b3114e5b
Allow \circ command in bonds in TexVCPHP
Add \circ to mhchem macros to allow them in bonds.

Bug: T328833
Change-Id: I3100033904e28a181a2e674da388832678eb0db3
2023-02-15 14:25:30 +01:00
Stegmujo 1865fbf31b Fix low scores for oint statements
Bug: T327392

Change-Id: Ia4afc6d6674793ee5d120b20d1ce6f60a12d5e4a
2023-02-13 15:11:54 +00:00
Stegmujo 39c400a431 Fix Parsing of Mod elements with and without params
* some adaptions to test and comparator
* minor fix in mappings for ncong
* introduce a LaTeXML Fallback for the tex-cases:
** "\ce{\ca}"
** "\mod"

Bug: T327392

Change-Id: Ie2efa392bd517a28fe8b6e8d0cecdba64cd1c415
2023-02-13 12:23:44 +00:00
Stegmujo dbf15a72c6 Fix parsing functions for MMLGenerationTexVCUtilTest
* for "oint","ointctrclockwise", "varointclockwise."
* some ignored attributes added to similarity algorithm

Bug: T327392
Change-Id: Id4cf720bb2d2c8aeb524c2303bdf0d4be3547404
2023-02-08 14:30:46 +00:00
Stegmujo 5eba9b74a0
Optimize Test Parametrization
* For MMLGenTexVCUtilTest and the MMLComparator
* Also skip some inputs which are not supported

Bug: T327392
Change-Id: Ifac913e2b8e4c70c7222f769c0e7cf93e65de5b8
2023-02-06 17:13:38 +01:00
Stegmujo be8725c1d2
Add New TexUtil-Reference which also has Chem
* Update maintanance script with Chem-Fallback
* delete obsolete MML Lookup (was from mathjax-full)
* TexUtil-Ref is created without chem fallback

Bug: T327388
Change-Id: Id603d66feccf3716828c2aac57acac7d23131ddf
2023-02-06 16:30:25 +01:00
Stegmujo 17d9ade3f2 Insert MathML-Comparator features in MathML-Tests
Bug: T327393
Change-Id: I1d781587cf62d034493a06a4a9640d0dd14c8386
2023-02-03 14:58:52 +00:00
Stegmujo a1cddd7e0d Add MathML-Comparator algorithm for the automated tests
* Compares two MathML trees
* Calculates F-Score and Diffs

Bug: T885309
Change-Id: Iabdb5b12054e4c1ce6e2c756643bafd371da6fb0
2023-02-03 10:24:17 +00:00
Stegmujo 8d522c4022 New lookups for tests enabling reference MathML
* For the existing MMLGeneration...Tests, reference MathML has been generated
for mathoid and latexml within reference files in json.
* The creation of json files was done with JsonToMathML script
* The test-classes have been adapted a bit, so they can read the new reference files.
* MMLGenerationTexUtil test has export function for input
for maintenance-script for

Bug: T327388
Change-Id: I05a8c7bb5e37cf75faf09ec43e9ce2acc7bf2040
2023-01-27 20:52:10 +00:00
Stegmujo ada1d6e3db
Add Full-Coverage Test TexVC-MMLGeneration for Mathoid-LateXML
* Implemented multiple-column generation for the HTML-Generator
* Items can be skipped in test by defining index

Bug: T327386
Change-Id: I13148d58246ddcc1f2e6dcd14fa5b4255a1fb8e7
2023-01-26 13:12:19 +01:00
jenkins-bot 347dcbd3fe Merge "Fix significant typo in grammar" 2023-01-03 16:02:27 +00:00
jenkins-bot 6153004078 Merge "Improve security of MathML output" 2023-01-03 15:28:24 +00:00
Moritz Schubotz (physikerwelt) 7b425a5500
Improve security of MathML output
Avoid that user input is passed to the HTML output directly by using
HTML methods for tag generation. This also enables additional phan checks.

Change-Id: Iff584ac829c190e413a36331c53d6835a86bc0d5
2023-01-03 15:47:54 +01:00
Moritz Schubotz (physikerwelt) 0aecf2ab10
Expand texvcjs comparison test
* Currently the regression test only tests if all formulae that passed the test before still pass the test

* This change also compares the output

Change-Id: Ib667de2e7e512cf7d045e28a19c6a5f7d994dfc6
2022-12-30 19:53:31 +01:00
Moritz Schubotz (physikerwelt) 81fa5b0c97
Fix significant typo in grammar
* Uq and Dq was mixed
* Simplify regeneration of grammar for node developers
* Speed up npm test by ignoring local test json files

Change-Id: Iec273dcc967be46d3df52260fc56f1969667e497
2022-12-30 16:58:39 +01:00
Moritz Schubotz (physikerwelt) e4affc08ec
Fix HTML testtable generation
* Do not generate a new table for every case

Change-Id: I0352a30e66fc7c43ac18e5a09b5794bc50a9b98c
2022-12-29 11:03:29 +01:00
jenkins-bot 5ad3a47d0d Merge "Improve test coverage for nodes" 2022-12-28 20:45:52 +00:00
jenkins-bot 98aeec1201 Merge "Add tests for more TeX statements" 2022-12-28 19:40:11 +00:00
Moritz Schubotz (physikerwelt) b9e297c4ec Improve test coverage for nodes
* Use merror instead of plain strings for not implemented functions

Change-Id: If20559e05f3b0c8921a28c623102b8f4788a3c94
2022-12-28 19:18:21 +00:00
Moritz Schubotz (physikerwelt) 469c698e47
Improve checking performance
* Report only on used packages if requested

Change-Id: I5b4fc6d7e571206f5b5d41d3bf268251ed1a8677
2022-12-28 13:34:23 +01:00
Stegmujo 6581889158
Add tests for more TeX statements
* These can be used for development purposes

Bug: T302628
Change-Id: I620b0a44b30b88a68f8f806b9c20ddabfe227573
2022-12-28 11:34:45 +01:00
jenkins-bot 00e7d44ec6 Merge "Use named data sets in AllTest" 2022-12-28 09:30:57 +00:00
Moritz Schubotz (physikerwelt) b0cacbc1a6
Use named data sets in AllTest
Change-Id: Ia8ceb06f2d2ec5a4f5935fb0d4b6e95e466ce002
2022-12-28 09:46:19 +01:00
Moritz Schubotz (physikerwelt) 70acbd7ea4
Fix missing curlies in chem nodes
* the php implementation had fewer curlies compared to the
  js implmenetation

* remove unused function name (could be replace get_class)

* Add testcase for declh

Change-Id: I8132604a659d7ddf98e1f73686b40ff0591229f3
2022-12-28 00:56:47 +01:00
Stegmujo 783797bb9a
Add test for basic MML Methods
Bug: T302628
Change-Id: Ib3d781a516e53392fb09a2c70b322805dcb43fcf
2022-12-23 22:46:59 +01:00
Moritz Schubotz (physikerwelt) cbd67195f5
Update positive regression tests
Adapt test running structure to the new structure for good tests
coming from texvcjs.

Change-Id: I330bb3f8f0c6f379d624986827f96946af1d4c12
2022-12-06 10:59:39 +01:00
thiemowmde 566944c42d Fix broken/incomplete regex patterns in TexNode::texContainsFunc
I compared with
6c6988c4f6/lib/astutil.js
and found two mistakes:
* Missing space at the end of the color regex.
* Not enough backslash escaping in the last regex.

Note how the code in lines #116 and #130 is now identical.

Change-Id: I13b75ad4a1e4da0766c0d73b8786b21865945697
2022-12-01 17:05:30 +01:00
thiemowmde f09ce3134b Add many more testcases for TexNode::texContainsFunc()
Positive as well as negative tests. This patch intentionally doesn't
touch the implementation but simply documents how the code currently
behaves.

Change-Id: Ib670ad680087e520f4a99e932e5a2a9fd2d115de
2022-12-01 16:57:28 +01:00
thiemowmde f459b0b305 Rewrite TexNodeTest to use @dataProviders
Personally I find this easier to read. It allows to maintain a compact
list of input values with the expected output.

Change-Id: Ifeb532e2b94c674b512b3c40f101977939b83cd5
2022-12-01 16:34:40 +01:00
jenkins-bot 99b1b231c5 Merge "Fix assert functions in En-MediaWiki-Testcase" 2022-11-29 20:12:52 +00:00
jenkins-bot 04c839d680 Merge "Skip tests that are known to fail" 2022-11-29 19:38:44 +00:00
Stegmujo d4418049c8
Fix assert functions in En-MediaWiki-Testcase
Change-Id: I9355d86e9a482fa2f86aac19a2018a6ad149ef20
2022-11-29 20:29:11 +01:00
thiemowmde f4ed725712 Fix and add test for "0" special case in TexNode
We fixed this in I47b6d5b but broke it again in Ie8d8106. Let's
finally add a test for this edge-case.

Change-Id: I9a43518f9edf0fab05e76bbb02a30fefd039b77d
2022-11-29 12:11:15 +01:00
Moritz Schubotz (physikerwelt) 7ecce2a104
Skip tests that are known to fail
* don't return on skipped tests
* add some additional non math test cases

Change-Id: Ia389141693a2e2ed6dea4294549674402e109d64
2022-11-27 15:08:56 +01:00
jenkins-bot e0f6e21ac7 Merge "Remove PNG rendering mode" 2022-11-22 19:07:20 +00:00
thiemowmde 67906845ff Make use of ?: and ?? shortcut syntax where it makes sense
I hope this makes the code more readable.

Change-Id: Ie458551d26cd8c8cd6e1cc18789d93176230f0d4
2022-11-22 12:29:44 +01:00
Moritz Schubotz (physikerwelt) 110656335f Remove PNG rendering mode
Removes functionality to
* select PNG rendering mode
* automated fallback to PNG images for SVG rendering
* PNG mode related class and tests

However, PNG images received from mathoid / restbase are still stored.

Bug: T311620
Change-Id: I595926027433182cc0396570bc3f1ce0cd2cafb3
2022-11-21 18:57:27 +00:00
jenkins-bot 4b6137bed4 Merge "Avoid try…catch where if…else will do when using LanguageFactory" 2022-11-21 08:57:13 +00:00
Bartosz Dziewoński 1b7a46ff4f Avoid try…catch where if…else will do when using LanguageFactory
Needed for I869af06896b9757af18488b916211c5a41a8c563, where I am
trying to change LanguageFactory in MediaWiki core not to use
MWException.

I truly feel mocked after working with this code. See if you can find
the two lines in this diff where the meaningful changes are.

Change-Id: Ifcb31dbb7113ce57526f06558cde2abedee317d7
2022-11-18 21:08:24 +01:00
Reedy 6081e9b01a DeclhTest: Fix string interpolation
Bug: T314096
Change-Id: I1c2a11c1481ca7d8e91e9c0468600ace9038e333
2022-11-04 18:08:02 -06:00
jenkins-bot 3dcdbbd95b Merge "Fix Perfomance Issues of TexUtil" 2022-10-25 18:10:09 +00:00
Stegmujo b5d3bca4b4 Fix Perfomance Issues of TexUtil
TexUtil gets instanciated and loads a json for each node in Literal and Fun1. This is not necessary since it takes much RAM and time to load the corresponding JSON from files.

Bug: T321599

Change-Id: I91855ebc4437f075302ae13d367ca4902cc0f3ba
2022-10-25 17:44:02 +00:00
Stegmujo d2bd2f4554
Add Tests and Downloader for Chem Input Types
Bug: T321262

Change-Id: I4e0af8ab0eaa02829dffb7ff5fccc4564ed5c1ba
2022-10-25 16:55:58 +02:00
Stegmujo caf3a1e26b
Add All Wikipedia Tests and Fixes
These tests are skipped in CI, but are ran locally.
Contains also preliminary fixes to make the assertions not crash
locally and a shellscript for downloading the json-file with tests locally.

Bug: T315223

Change-Id: If5da7e2a29d9179eabecbb4707ed244f5d445d39
2022-10-25 15:32:53 +02:00
Stegmujo c27f7edef9 Add Integration for the TexVC-PHP check to Math
Bug: T312528

Change-Id: I0eda7d4213a5f703ab7ae7887aa364af9e576dbe
2022-10-20 16:39:19 +00:00
Stegmujo 8333e2541a Create Tests for Parser and TexVC
Parser.php is excluded from linting steps.

Bug: T312528

Change-Id: I372832bb9ea212f9bc06947d0ef192f270dc54c2
2022-10-19 17:25:20 +00:00