Skip to content

Commit

Permalink
test: add tests for MathMl::map
Browse files Browse the repository at this point in the history
  • Loading branch information
nfejzic committed Dec 22, 2023
1 parent cc4c708 commit e49cabc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/others/mapping.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
use alemat::{
elements::{grouping::Row, Frac, Ident},
MathMl,
};

#[test]
fn map_in_row() {
let out = MathMl::with_content(
Frac::builder()
.num(Ident::from("x"))
.denom(Ident::from("y"))
.build(),
)
.map(Row::from)
.render();

crate::snap_test!(out, name: "others_map_in_row");
}
1 change: 1 addition & 0 deletions tests/others/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mod annotation;
mod mapping;
mod mfrac;
mod mi;
mod mn;
Expand Down
17 changes: 17 additions & 0 deletions tests/snapshots/others_map_in_row.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
source: tests/others/mapping.rs
expression: input
---
<math>
<mrow>
<mfrac>
<mi>
x
</mi>
<mi>
y
</mi>
</mfrac>
</mrow>
</math>

0 comments on commit e49cabc

Please sign in to comment.