Skip to content

Commit

Permalink
Add a unit test for a multiline formula (ForNeVeR#149)
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Jan 6, 2020
1 parent 1df3915 commit fbcf311
Show file tree
Hide file tree
Showing 2 changed files with 274 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/WpfMath.Tests/ParserTests.fs
Original file line number Diff line number Diff line change
Expand Up @@ -285,3 +285,7 @@ let colorModelsWithOpacity(text: string): unit =
verifyParseResultScenario
<| processSpecialChars text
<| text

[<Fact>]
let multilineFormula(): unit =
verifyParseResult @"line 1\\line 2\\line 3"
Original file line number Diff line number Diff line change
@@ -0,0 +1,270 @@
{
"TextStyle": null,
"RootAtom": {
"PreviousAtom": null,
"Elements": [
{
"MatrixCells": [
[
{
"PreviousAtom": null,
"Elements": [
{
"MatrixCells": [
[
{
"PreviousAtom": null,
"Elements": [
{
"Character": "l",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 0,
"End": 1,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "i",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 1,
"End": 2,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "n",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 2,
"End": 3,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "e",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 3,
"End": 4,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "1",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 5,
"End": 6,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
],
"Type": "Ordinary",
"Source": {
"Start": 0,
"End": 6,
"Length": 6,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
],
[
{
"Character": "l",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 8,
"End": 9,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
]
],
"VerticalPadding": 0.35,
"HorizontalPadding": 0.35,
"MatrixCellAlignment": "Center",
"Type": "Ordinary",
"Source": {
"Start": 7,
"End": 9,
"Length": 2,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "i",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 9,
"End": 10,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "n",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 10,
"End": 11,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "e",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 11,
"End": 12,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "2",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 13,
"End": 14,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
],
"Type": "Ordinary",
"Source": {
"Start": 0,
"End": 14,
"Length": 14,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
],
[
{
"Character": "l",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 16,
"End": 17,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
]
],
"VerticalPadding": 0.35,
"HorizontalPadding": 0.35,
"MatrixCellAlignment": "Center",
"Type": "Ordinary",
"Source": {
"Start": 15,
"End": 17,
"Length": 2,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "i",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 17,
"End": 18,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "n",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 18,
"End": 19,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "e",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 19,
"End": 20,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
},
{
"Character": "3",
"TextStyle": null,
"IsDefaultTextStyle": true,
"IsTextSymbol": false,
"Type": "Ordinary",
"Source": {
"Start": 21,
"End": 22,
"Length": 1,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
],
"Type": "Ordinary",
"Source": {
"Start": 0,
"End": 22,
"Length": 22,
"Source": "line 1\\\\line 2\\\\line 3"
}
}
}

0 comments on commit fbcf311

Please sign in to comment.