Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MathML Core Testsuite

Local mirror of the W3C MathML Core (MathML v4) testsuite, sourced from the Web Platform Tests (WPT) monorepo at https://github.com/web-platform-tests/wpt/tree/master/mathml .

MathML Core is the modern, core subset of MathML. The W3C no longer maintains a standalone MathML testsuite — the tests have been contributed to the WPT monorepo.

Source

What is synced

The mathml/ subdirectory contains extracted <math> elements as standalone .mml files, with the directory structure mirroring the WPT source.

Directory Description

mathml/presentation-markup

MathML presentation element tests (fractions, operators, scripts, radicals, tables, tokens, direction, spaces, mrow, mpadded, menclose)

mathml/relations

CSS-MathML interaction tests

mathml/crashtests

Crash regression tests (including mozilla/ subdirectory)

The raw WPT files (HTML/XHTML) live in .wpt-cache/mathml/ and are not copied into mathml/ — only the extracted <math> elements are.

Note

Some WPT tests — particularly crashtests — contain intentionally malformed MathML that browsers tolerate but is not valid MathML (e.g. missing <math> wrappers, unclosed tags, invalid nesting). These are skipped during extraction.

Root-level files synced from mathml/:

  • META.yml — WPT metadata (spec URL, suggested reviewers)

  • WEB_FEATURES.yml — Web Features configuration

  • README.md — Documents font requirements and tools

Sync

# Install dependencies (first time only)
bundle install

# Clone wpt monorepo (sparse, shallow) and extract .mml files on first run
./scripts/sync.rb

# Pull latest from upstream and re-extract on subsequent runs
./scripts/sync.rb

The script clones the full wpt monorepo using git sparse checkout to fetch only the mathml/ subtree, keeping the local clone small. A .wpt-cache/ directory inside this repo holds the wpt cache; it is excluded from version control via .gitignore.

Requires: git, Ruby 3.x, Bundler, Nokogiri

Test Format

Tests use standard WPT formats:

  • Reftest — visual comparison via <link rel="match"> / <link rel="mismatch">

  • testharness.js — programmatic assertions (assert_true, assert_approx_equals, etc.)

Support utilities in mathml/support/: feature-detection.js, fonts.js, box-comparison.js, layout-comparison.js, etc.

Tests require Web fonts (WOFF) generated by the scripts in mathml/tools/ using FontForge.

License

These tests are provided under the same license as the WPT monorepo. See https://www.w3.org/Consortium/Legal/2015/software-license .

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages