// Tests based on the Finnish flavor of ASCIIMath located on the Finnish delegation for braille's "Matematiikan, fysiikan ja kemian merkinnät elektronisissa oppikirjoissa" (https://www.pistekirjoitus.fi/julkaisut/matematiikka-ja-tietotekniikka/).
// Tests will be named according to the page and some identification.
use crate::common::*;
#[test]
fn p12_equal () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"3 +4 =7");
}
#[test]
fn p12_not_equal () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"5 -2 !=2");
}
#[test]
fn p12_opposite () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"9 -3 != 5");
}
#[test]
fn p12_multiplication_visible_op () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"27 *3");
}
#[test]
fn p12_simple_frac () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"1/3");
}
#[test]
fn p12_ratio () {
let expr = r#""#;
test_braille_prefs("ASCIIMath-fi", expr, r"1 :1000");
}
#[test]
fn p12_fractional () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"(6 x +3 x) /(6 x -4 x)");
}
#[test]
fn p12_absolute_value_eq () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"|-(2 +5)| =|-7| =7");
}
#[test]
fn p12_natural_numbers () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"NN ={0, 1, 2, 3, ...}");
}
#[test]
fn p12_whole_numbers () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"ZZ ={..., -2, 1, 0, 1, 2, ...}");
}
#[test]
fn p13_pi () {
let expr = r#""#;
test_braille_prefs("ASCIIMath", vec![("DecimalSeparators", ","), ("BlockSeparators", ". ")], expr, r"~p ~~3,14");
}
#[test]
fn p13_less_than () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"x < 18");
}
#[test]
fn p13_greater_or_equal () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"2 x >= 6");
}
#[test]
fn p13_fraction_with_invisible_plus () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"3#5/6");
}
#[test]
fn p13_fraction_without_invisible_plus () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"3#5/6");
}
#[test]
fn p13_fractional_no_paren () {
// The numerator doesn't require parentheses to be read correctly.
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"4 x /(1 -x)");
}
#[test]
fn p13_fractional () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"(5 +x) /(5 x)");
}
#[test]
fn p13_fractional_simplifying_with_paren () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"(5 +7) /(2 *3) =12 /6");
}
#[test]
fn p14_long_fractional () {
let expr = r#""#;
test_braille("ASCIIMath-fi", expr, r"((x^2 -7 x +12) /(4 x -20)) /((x^2 -8 x +15) /(4 x -16))");
}
#[test]
fn p15_exponent_plus () {
let expr = r#"