// Swedish braille tests for the basic mathml tags
// These tests are from the Swedish braille authority's publication "Punktskriftens skrivregeler för matematik och naturvetenskap"
// https://www.mtm.se/globalassets/punktskriftsnamnden/punktskriftens_skrivregler_matematik.pdf
use crate::common::*;
#[test]
fn ex_1_4() {
let expr= r#""#;
test_braille("Swedish", expr, "⠁⠀⠼⠕⠀⠕⠀⠼⠕⠕⠀⠃");
}
// CHAPTER 5
#[test]
fn ex_5_1() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠑⠀⠲⠀⠼⠁⠃");
}
#[test]
fn ex_5_2() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠊⠂⠊⠊⠀⠲⠀⠼⠚⠂⠚⠚⠁");
}
#[test]
fn ex_5_3() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠁⠌⠼⠃⠀⠲⠀⠼⠁⠌⠼⠃");
}
#[test]
fn ex_5_4() {
let expr= r#""#;
test_braille("Swedish", expr, "⠽⠀⠶⠀⠼⠑⠀⠲⠀⠭");
}
#[test]
fn ex_5_5() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠋⠁⠉⠀⠤⠀⠼⠃⠃⠁");
}
#[test]
fn ex_5_6() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠁⠚⠂⠁⠀⠤⠀⠼⠉⠂⠚⠑");
}
#[test]
fn ex_5_7() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠉⠼⠁⠳⠼⠙⠀⠤⠀⠼⠁⠼⠉⠳⠼⠙");
}
#[test]
fn ex_5_8() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠚⠂⠑⠀⠲⠀⠼⠉⠂⠙⠀⠲⠀⠼⠋⠀⠤⠀⠼⠛⠂⠑⠀⠤⠀⠼⠚⠂⠚⠃");
}
#[test]
fn ex_5_9() {
let expr= r#""#;
test_braille("Swedish", expr, "⠰⠁⠀⠨⠲⠤⠀⠼⠃⠰⠏");
}
#[test]
fn ex_5_10() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠁⠑⠀⠻⠄⠀⠼⠁⠉");
}
#[test]
fn ex_5_11() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠙⠄⠑⠀⠻⠄⠀⠼⠁⠄⠙");
}
#[test]
fn ex_5_12() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠃⠱⠁⠃⠀⠻⠄⠀⠼⠃⠱⠁⠃⠀⠻⠄⠀⠼⠃⠱⠁⠃");
}
#[test]
fn ex_5_13() {
let expr= r#""#;
// FIXED: added spaces around · because that is in the TeX list of binary ops -- it is also that way in the spec
test_braille("Swedish", expr, "⠨⠗⠀⠨⠻⠄⠀⠨⠝⠀⠶⠀⠨⠎⠀⠨⠻⠄⠀⠨⠝");
}
#[test]
fn ex_5_14() {
let expr= r#""#;
test_braille("Swedish", expr, "⠠⠠⠇⠑⠞⠀⠠⠉⠀⠶⠀⠠⠁⠔⠠⠃");
}
#[test]
fn ex_5_15() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠃⠙⠀⠻⠭⠀⠼⠉⠋");
}
#[test]
fn ex_5_16() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠃⠉⠁⠳⠼⠛");
}
#[test]
fn ex_5_17() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠚⠂⠋⠙⠳⠼⠚⠂⠚⠓");
}
#[test]
fn ex_5_18() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠚⠂⠃⠌⠼⠚⠂⠚⠚⠙");
}
#[test]
fn ex_5_19() {
let expr= r#""#;
test_braille("Swedish", expr, "⠠⠗⠊⠞⠝⠊⠝⠛⠑⠝⠀⠧⠁⠗⠀⠊⠀⠎⠅⠁⠇⠁⠀⠼⠁⠒⠼⠁⠚⠚");
}
// CHAPTER 6
#[test]
fn ex_6_1() {
let expr= r#""#;
test_braille("Swedish", expr, "⠭⠳⠼⠃⠀⠶⠀⠼⠊");
}
#[test]
fn ex_6_2() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠑⠌⠼⠑⠀⠶⠀⠼⠁");
}
#[test]
fn ex_6_3() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠉⠳⠼⠙⠀⠲⠀⠼⠁⠳⠼⠉⠀⠶⠀⠼⠊⠳⠼⠁⠃⠀⠲⠀⠼⠙⠳⠼⠁⠃⠀⠶⠀⠼⠁⠉⠳⠼⠁⠃");
}
#[test]
fn ex_6_4() {
let expr= r#""#;
test_braille("Swedish", expr, "⠦⠭⠲⠼⠁⠴⠳⠦⠭⠤⠼⠁⠴");
}
#[test]
fn ex_6_5() {
let expr= r#""#;
test_braille("Swedish", expr, "⠿⠦⠭⠲⠼⠁⠳⠭⠤⠼⠁⠿⠴");
}
#[test]
fn ex_6_6() {
let expr= r#""#;
// FIXED: the example made both fractions have start/end indicators, but the first one doesn't need them and so they were removed from the output
test_braille("Swedish", expr, "⠼⠃⠱⠁⠳⠃⠀⠶⠀⠿⠦⠼⠃⠱⠁⠳⠃⠿⠴");
}
#[test]
fn ex_6_7() {
let expr= r#""#;
// FIXED: removed space before "lg" as that is not *required* in braille
test_braille("Swedish", expr, "⠿⠦⠇⠛⠀⠭⠳⠼⠁⠚⠿⠴⠀⠶⠀⠼⠚⠂⠁⠇⠛⠀⠭");
}
#[test]
fn ex_6_8() {
let expr= r#""#;
test_braille("Swedish", expr, "⠇⠛⠿⠦⠭⠳⠼⠁⠚⠿⠴⠀⠶⠀⠇⠛⠀⠭⠀⠤⠀⠼⠁");
}
#[test]
fn ex_6_9() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠉⠼⠁⠳⠼⠙⠀⠤⠀⠼⠁⠼⠉⠳⠼⠙⠀⠶⠀⠼⠃⠼⠑⠳⠼⠙⠀⠤⠀⠼⠁⠼⠉⠳⠼⠙⠀⠶⠀⠼⠁⠼⠃⠳⠼⠙⠀⠶⠀⠼⠁⠼⠁⠳⠼⠃");
}
#[test]
fn ex_6_10() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠉⠀⠼⠁⠌⠼⠙⠀⠤⠀⠼⠁⠀⠼⠉⠌⠼⠙⠀⠶⠀⠼⠃⠀⠼⠑⠌⠼⠙⠀⠤⠀⠼⠁⠀⠼⠉⠌⠼⠙⠀⠶⠀⠼⠁⠀⠼⠃⠌⠼⠙⠀⠶⠀⠼⠁⠀⠼⠁⠌⠼⠃");
}
#[test]
fn ex_6_11() {
let expr= r#""#;
// FIXED: removed spacing around ⋅ (dot multiply) in numerator
test_braille("Swedish", expr, "⠿⠦⠼⠁⠉⠻⠄⠼⠛⠳⠼⠃⠿⠴");
}
#[test]
fn ex_6_12() {
let expr= r#""#;
// FIXED: removed spacing around ⋅ (dot multiply) in numerator [adding space here makes no sense because if anything "-" should have space]
// FIXED: removed spacing around fraction line sign (⠳)
test_braille("Swedish", expr, "⠿⠦⠼⠑⠑⠲⠦⠤⠼⠁⠓⠴⠻⠄⠼⠃⠤⠦⠤⠼⠋⠉⠴⠳⠦⠤⠼⠉⠴⠤⠦⠤⠼⠛⠴⠿⠴");
}
#[test]
fn ex_6_13() {
let expr= r#""#;
test_braille("Swedish", expr, "⠿⠦⠝⠦⠝⠤⠼⠁⠴⠀⠄⠄⠄⠀⠦⠝⠤⠅⠲⠼⠁⠴⠳⠅⠖⠿⠴");
}
#[test]
fn ex_6_14() {
let expr= r#""#;
// FIXED: removed spaces around fraction line (⠳)
test_braille("Swedish", expr, "⠠⠏⠦⠠⠁⠴⠀⠶⠀⠿⠦⠠⠝⠥⠍⠃⠑⠗⠀⠕⠋⠀⠕⠥⠞⠉⠕⠍⠑⠎⠀⠊⠝⠀⠠⠁⠳⠠⠞⠕⠞⠁⠇⠀⠝⠥⠍⠃⠑⠗⠀⠕⠋⠀⠕⠥⠞⠉⠕⠍⠑⠎⠿⠴");
}
#[test]
fn ex_6_15() {
let expr= r#""#;
// FIXED: removed spacing around "+"s in continued fraction (left spaces in around ellipsis)
test_braille("Swedish", expr, "⠃⠣⠼⠚⠀⠲⠀⠿⠦⠁⠣⠼⠁⠳⠃⠣⠼⠁⠲⠿⠦⠁⠣⠼⠃⠳⠃⠣⠼⠃⠲⠀⠄⠄⠄⠀⠲⠁⠣⠝⠳⠃⠣⠝⠿⠴⠿⠴");
}
#[test]
fn ex_6_16() {
let expr= r#""#;
// FIXED: removed spacing around complex fraction line sign (⠳⠳)
test_braille("Swedish", expr, "⠵⠀⠶⠀⠿⠦⠼⠛⠭⠤⠼⠋⠽⠳⠼⠑⠭⠲⠼⠓⠽⠿⠴⠳⠳⠿⠦⠼⠛⠭⠤⠼⠋⠽⠳⠼⠓⠽⠲⠼⠑⠭⠿⠴");
}
#[test]
fn ex_6_17() {
let expr= r#""#;
// FIXED: removed spacing around complex fraction line sign (⠳⠳)
test_braille("Swedish", expr, "⠵⠀⠶⠀⠿⠦⠼⠁⠲⠿⠦⠼⠛⠭⠤⠼⠋⠽⠳⠼⠑⠭⠲⠼⠓⠽⠿⠴⠳⠳⠿⠦⠼⠛⠭⠤⠼⠋⠽⠳⠼⠓⠽⠲⠼⠑⠭⠿⠴⠿⠴");
}
#[test]
fn ex_6_18() {
let expr= r#""#;
// FIXED: removed spacing around complex fraction line sign (⠌⠌)
test_braille("Swedish", expr, "⠿⠦⠭⠲⠽⠳⠼⠋⠭⠿⠴⠌⠌⠿⠦⠭⠲⠽⠳⠼⠃⠭⠿⠴⠀⠶⠀⠼⠁⠳⠼⠉");
}
#[test]
fn ex_6_19() {
// FIXED: Added non-breaking spaces around the text
let expr= r#""#;
// FIXED: removed spacing around complex fraction line signs (⠳⠳ and ⠌⠌)
test_braille("Swedish", expr, "⠿⠦⠼⠊⠳⠼⠋⠳⠳⠼⠉⠿⠴⠂⠀⠿⠦⠼⠊⠳⠼⠋⠌⠌⠼⠉⠿⠴⠀⠕⠉⠓⠀⠿⠦⠼⠊⠌⠼⠋⠳⠳⠼⠉⠿⠴⠀⠃⠑⠞⠑⠉⠅⠝⠁⠗⠀⠞⠁⠇⠑⠞⠀⠼⠁⠂⠑⠳⠼⠉");
}
#[test]
fn ex_6_20() {
let expr= r#""#;
// FIXED: removed spacing around complex fraction line sign (⠳⠳)
test_braille("Swedish", expr, "⠿⠦⠁⠲⠃⠳⠁⠤⠃⠿⠴⠀⠶⠀⠿⠦⠞⠁⠝⠿⠦⠰⠁⠲⠰⠃⠳⠼⠃⠿⠴⠳⠳⠞⠁⠝⠿⠦⠰⠁⠤⠰⠃⠳⠼⠃⠿⠴⠿⠴");
}
#[test]
fn ex_6_21() {
// FIXED: added 'intent' to disambiguate
let expr= r#""#;
test_braille("Swedish", expr, "⠦⠝⠘⠳⠅⠴⠀⠶⠀⠿⠦⠝⠖⠳⠦⠝⠤⠅⠴⠖⠅⠖⠿⠴");
}
#[test]
fn ex_6_21_mfrac() {
let expr= r#""#;
test_braille("Swedish", expr, "⠦⠝⠘⠳⠅⠴⠀⠶⠀⠿⠦⠝⠖⠳⠦⠝⠤⠅⠴⠖⠅⠖⠿⠴");
}
// CHAPTER 7
#[test]
fn ex_7_1() {
let expr= r#""#;
test_braille("Swedish", expr, "⠦⠼⠃⠬⠼⠑⠴⠬⠼⠉⠀⠶⠀⠼⠃⠬⠼⠁⠑");
}
#[test]
fn ex_7_2() {
let expr= r#""#;
test_braille("Swedish", expr, "⠭⠬⠼⠃⠽⠀⠻⠄⠀⠭⠬⠼⠉⠽⠬⠼⠃");
}
#[test]
fn ex_7_3() {
let expr= r#""#;
test_braille("Swedish", expr, "⠋⠬⠦⠼⠃⠍⠤⠼⠁⠴");
}
#[test]
fn ex_7_4() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠁⠚⠬⠤⠼⠁⠃");
}
#[test]
fn ex_7_5() {
let expr= r#""#;
test_braille("Swedish", expr, "⠵⠬⠝⠀⠶⠀⠦⠗⠑⠘⠬⠊⠰⠓⠱⠴⠬⠝⠀⠶⠀⠗⠬⠝⠑⠘⠬⠊⠝⠰⠓⠱");
}
#[test]
fn ex_7_6() {
let expr= r#""#;
test_braille("Swedish", expr, "⠑⠘⠬⠤⠦⠰⠏⠳⠼⠃⠲⠼⠃⠝⠰⠏⠴⠲⠊⠇⠝⠼⠃⠱");
}
#[test]
fn ex_7_7() {
let expr= r#""#;
test_braille("Swedish", expr, "⠼⠃⠬⠼⠃⠘⠬⠝⠤⠼⠁⠱");
}
#[test]
fn ex_7_8() {
let expr= r#""#;
test_braille("Swedish", expr, "⠬⠁⠇⠕⠛⠀⠭⠀⠲⠀⠬⠁⠇⠕⠛⠀⠽⠀⠶⠀⠬⠁⠇⠕⠛⠀⠭⠽");
}
#[test]
fn ex_7_9() {
let expr= r#""#;
test_braille("Swedish", expr, "⠑⠘⠬⠤⠭⠬⠼⠃⠌⠼⠙⠱⠁⠤⠽⠬⠼⠃⠌⠼⠙⠱⠃⠤⠵⠬⠼⠃⠌⠼⠙⠱⠉⠱");
}
#[test]
fn ex_7_10() {
let expr= r#""#;
test_braille("Swedish", expr, "⠭⠣⠼⠁⠂⠀⠭⠣⠼⠃⠂⠀⠄⠄⠄⠂⠀⠭⠘⠣⠍⠤⠼⠁⠱");
}
#[test]
fn ex_7_11() {
let expr= r#""#;
test_braille("Swedish", expr, "⠣⠼⠊⠃⠬⠼⠃⠉⠓⠠⠥");
}
#[test]
fn ex_7_12() {
let expr= r#""#;
test_braille("Swedish", expr, "⠠⠠⠎⠕⠣⠼⠙⠘⠬⠼⠃⠤⠱");
}
#[test]
fn ex_7_13() {
let expr= r#""#;
test_braille("Swedish", expr, "⠣⠼⠁⠬⠼⠁⠠⠓⠣⠼⠁⠬⠲");
}
#[test]
fn ex_7_14() {
let expr= r#""#;
// FIXED: added space around '-' (⠤)
test_braille("Swedish", expr, "⠇⠊⠍⠘⠣⠣⠝⠒⠕⠼⠿⠱⠀⠁⠣⠝⠀⠑⠭⠊⠎⠞⠑⠗⠁⠗⠀⠪⠶⠕⠀⠇⠊⠍⠘⠣⠣⠍⠒⠕⠼⠿⠱⠘⠣⠣⠝⠒⠕⠼⠿⠱⠀⠸⠁⠣⠍⠀⠤⠀⠁⠣⠝⠸⠀⠶⠀⠼⠚");
}
#[test]
fn ex_7_15() {
let expr= r#""#;
test_braille("Swedish", expr, "⠁⠬⠤⠃");
}
#[test]
fn ex_7_16() {
let expr= r#""#;
test_braille("Swedish", expr, "⠁⠃⠬⠬⠤");
}
#[test]
fn ex_7_17() {
let expr= r#""#;
test_braille("Swedish", expr, "⠽⠬⠬⠒⠀⠶⠀⠽");
}
#[test]
fn ex_7_18() {
let expr= r#""#;
test_braille("Swedish", expr, "⠧⠣⠣⠶⠀⠶⠀⠧⠣⠣⠤");
}
#[test]
fn ex_7_19() {
let expr= r#""#;
test_braille("Swedish", expr, "⠰⠎⠬⠬⠖⠬⠼⠃⠀⠶⠀⠎⠬⠼⠃");
}
#[test]
fn ex_7_20() {
let expr= r#""#;
test_braille("Swedish", expr, "⠰⠺⠬⠬⠤⠬⠼⠃⠀⠶⠀⠠⠅⠳⠠⠍");
}
#[test]
fn ex_7_21() {
let expr= r#""#;
test_braille("Swedish", expr, "⠃⠔⠁⠀⠶⠀⠘⠁⠔⠃⠱⠬⠬⠤");
}
#[test]
fn ex_7_22() {
let expr= r#""#;
test_braille("Swedish", expr, "⠘⠠⠠⠁⠃⠱⠬⠬⠒⠕");
}
#[test]
fn ex_7_23() {
let expr= r#""#;
// FIXED: added spaces around "+" (⠲) on the lefthand side of '=' to be consistent
test_braille("Swedish", expr, "⠘⠭⠀⠲⠀⠽⠱⠬⠬⠖⠀⠶⠀⠭⠬⠬⠖⠀⠲⠀⠽⠬⠬⠖");
}
#[test]
fn ex_7_24() {
// FIXED: this was changed to match what 7.24 in the spec (both mathml and braille)
let expr= r#""#;
test_braille("Swedish", expr, "⠣⠼⠁⠬⠼⠃⠭⠣⠣⠶⠬⠬⠖⠣⠁⠬⠃");
}
#[test]
fn ex_7_24_munderover() {
// This uses the "correct" MathML
let expr= r#""#;
test_braille("Swedish", expr, "⠣⠼⠁⠬⠼⠃⠭⠣⠣⠶⠬⠬⠖⠣⠁⠬⠃");
}
#[test]
fn ex_7_25() {
let expr= r#""#;
test_braille("Swedish", expr, "⠩⠼⠃⠑⠀⠶⠀⠼⠑");
}
#[test]
fn ex_7_26() {
let expr= r#""#;
test_braille("Swedish", expr, "⠩⠼⠁⠂⠑");
}
#[test]
fn ex_7_27() {
let expr= r#""#;
test_braille("Swedish", expr, "⠩⠸⠼⠑⠱⠉⠣⠝⠸");
}
#[test]
fn ex_7_28() {
let expr= r#""#;
test_braille("Swedish", expr, "⠘⠩⠁⠳⠼⠃⠱⠀⠶⠀⠩⠦⠁⠳⠼⠃⠴");
}
#[test]
fn ex_7_29() {
let expr= r#""#;
// FIXED: removed spaces around fraction line (⠳)
test_braille("Swedish", expr, "⠗⠀⠶⠀⠁⠳⠼⠙⠩⠿⠦⠼⠑⠚⠲⠼⠃⠃⠩⠼⠑⠳⠼⠑⠿⠴");
}
#[test]
fn ex_7_30() {
let expr= r#""#;
// FIXED: added space around "+" (⠲) -- it's on the baseline and there is a space around the "-"
test_braille("Swedish", expr, "⠎⠣⠁⠀⠶⠀⠘⠩⠃⠉⠷⠼⠁⠀⠤⠀⠦⠁⠳⠃⠀⠲⠀⠉⠴⠬⠼⠃⠾⠱");
}
#[test]
fn ex_7_31() {
let expr= r#""#;
test_braille("Swedish", expr, "⠬⠼⠉⠩⠼⠃⠛⠀⠶⠀⠼⠉");
}
#[test]
fn ex_7_32() {
let expr= r#""#;
test_braille("Swedish", expr, "⠬⠝⠩⠁⠱⠬⠍⠩⠁⠀⠶⠀⠘⠬⠍⠝⠱⠩⠁⠘⠬⠍⠲⠝⠱");
}
#[test]
fn ex_11_4() {
let expr= r#""#;
test_braille("Swedish", expr, "⠁⠀⠶⠀⠠⠋⠳⠍⠀⠶⠀⠿⠦⠍⠻⠄⠧⠬⠼⠃⠳⠗⠳⠳⠍⠿⠴⠀⠶⠕⠀⠁⠀⠶⠀⠗⠀⠻⠄⠀⠰⠺⠬⠼⠃");
}