// UEB tests for the basic mathml tags
// Initial tests are from BANA guidelines, mostly about initial chars for code switching
// http://www.brailleauthority.org/ueb/ueb_math_guidance/final_for_posting_ueb_math_guidance_may_2019_102419.pdf
// These tests start with "bana_"
//
// Many come from (refer to) https://iceb.org/guidelines_for_technical_material_2014.pdf
// For example, "fraction_6_1_1" is a fraction example from section 6.1, and is the first example there.
use crate::common::*;
#[test]
fn bana_2_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠋⠀⠐⠶⠀⠼⠁⠐⠦⠼⠃⠐⠦⠼⠉⠀⠐⠶⠀⠼⠁⠐⠖⠼⠃⠐⠖⠼⠉");
}
#[test]
fn bana_5_1() {
let expr = "";
test_braille("UEB", expr, "⠭⠐⠖⠽⠀⠐⠶⠀⠼⠋");
}
#[test]
fn bana_5_2() {
let expr = "";
test_braille("UEB", expr, "⠭⠰⠔⠼⠃⠐⠖⠽⠔⠼⠃⠀⠐⠶⠀⠰⠠⠉");
}
#[test]
fn bana_5_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠁⠨⠌⠃⠾⠐⠖⠷⠉⠨⠌⠙⠾");
}
#[test]
fn bana_5_4() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠁⠔⠝⠐⠦⠁⠔⠍⠀⠐⠶⠀⠁⠔⠣⠝⠐⠖⠍⠜⠰⠄");
}
#[test]
fn bana_5_5() {
let expr = "";
// BANA example contradicts GTM 9.2 that says don't use a space after a function name if there is an intervening indicator.
// Corrected: removed the space and the G1 indicator needed if a space were inserted
test_braille("UEB", expr, "⠰⠰⠇⠕⠛⠢⠭⠽");
}
#[test]
fn bana_5a_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠚⠚⠘⠚⠠⠋");
}
#[test]
fn bana_5a_1_baseline() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠚⠚⠘⠚⠠⠋");
}
#[test]
fn bana_5a_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠃⠑⠀⠅⠍⠰⠔⠼⠃");
}
#[test]
fn bana_5a_2_mtext() {
let expr = "";
test_braille("UEB", expr, "⠼⠃⠑⠀⠅⠍⠰⠔⠼⠃");
}
#[test]
fn bana_5a_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠋⠀⠰⠍⠀⠰⠰⠎⠔⠣⠐⠤⠼⠁⠜");
}
#[test]
fn bana_6_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠭⠐⠖⠽⠀⠐⠶⠀⠵⠀⠐⠶⠀⠞⠔⠼⠃⠲⠰⠄");
}
#[test]
fn cap_1_6_1() {
let expr = "";
test_braille("UEB", expr, "⠠⠠⠁⠃⠉⠙");
}
#[test]
fn cap_1_6_1_separate() {
let expr = "";
test_braille("UEB", expr, "⠠⠠⠁⠃⠉⠙");
}
#[test]
fn cap_1_6_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠠⠧⠀⠐⠶⠀⠠⠠⠊⠗");
}
#[test]
fn cap_1_6_4() {
let expr = "";
test_braille("UEB", expr, "⠠⠠⠁⠃⠰⠔⠼⠃");
}
#[test]
fn grade1_1_7_1() {
let expr = "";
// removed the spaces around the '-' from the braille -- they typically wouldn't be used
test_braille("UEB", expr, "⠼⠉⠐⠤⠼⠃⠼⠁⠌⠃⠀⠐⠶");
}
#[test]
fn grade1_1_7_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠽⠀⠐⠶⠀⠭⠐⠖⠼⠙⠰⠉");
}
#[test]
fn grade1_1_7_3_1() {
let expr = "";
// GTM says it can be either "⠼⠉⠭⠐⠤⠼⠙⠽⠐⠖⠽⠔⠼⠃⠀⠐⠶⠀⠭⠰⠔⠼⠃" or "⠰⠰⠰⠼⠉⠭⠐⠤⠼⠙⠽⠐⠖⠽⠔⠼⠃⠀⠐⠶⠀⠭⠔⠼⠃⠰⠄"
test_braille("UEB", expr, "⠼⠉⠭⠐⠤⠼⠙⠽⠐⠖⠽⠔⠼⠃⠀⠐⠶⠀⠭⠰⠔⠼⠃");
}
#[test]
fn grade1_1_7_3_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠭⠔⠼⠃⠐⠖⠼⠃⠭⠨⠌⠼⠁⠐⠖⠭⠔⠼⠃⠾⠀⠐⠶⠀⠼⠁");
}
#[test]
fn grade1_1_7_4() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠩⠐⠣⠽⠐⠤⠭⠔⠼⠃⠐⠜⠬");
}
#[test]
fn number_2_1_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠂⠚⠚⠚");
}
#[test]
fn number_2_1_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠑⠐⠚⠚⠚⠐⠚⠚⠚");
}
#[test]
fn number_2_2_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠓⠲⠊⠉");
}
#[test]
fn number_2_2_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠲⠛");
}
#[test]
fn number_2_2_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠲⠛");
}
#[test]
fn time_2_4_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠑⠒⠼⠉⠚⠀⠏⠍");
}
#[test]
fn time_2_4_1_mtext() {
// this was a bug when only mtext occurred
let expr = "";
test_braille("UEB", expr, "⠼⠑⠒⠼⠉⠚");
}
#[test]
fn roman_numeral_2_6_1() {
let expr = " ";
test_braille("UEB", expr, "⠠⠊⠂⠀⠠⠠⠊⠊⠀⠯⠀⠰⠠⠧");
}
#[test]
fn roman_numeral_2_6_2() {
let expr = " ";
test_braille("UEB", expr, "⠊⠂⠀⠧⠊⠀⠯⠀⠰⠭");
}
#[test]
fn roman_numeral_2_6_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠠⠠⠉⠙");
}
#[test]
fn bold_2_7_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠋⠛⠘⠆⠼⠓⠙⠑");
}
#[test]
fn bold_2_7_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠋⠛⠘⠂⠼⠓⠙⠑");
}
#[test]
fn bold_2_7_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠋⠛⠘⠂⠼⠓⠙⠘⠄⠼⠑");
}
#[test]
fn signs_2_10_2() {
let expr = "";
test_braille("UEB", expr, "⠈⠎⠼⠚⠲⠉⠚⠂⠀⠼⠉⠚⠰⠉⠀⠕⠗⠀⠼⠉⠚⠈⠉");
}
#[test]
fn signs_2_10_5() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠀⠋⠞⠀⠼⠋⠀⠔⠀⠕⠗⠀⠼⠁⠶⠀⠼⠋⠶⠶");
}
#[test]
fn signs_2_10_8() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠘⠚⠠⠉⠀⠕⠗⠀⠼⠉⠃⠘⠚⠠⠋");
}
#[test]
fn signs_2_10_16() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠀⠠⠘⠫⠁⠀⠐⠶⠀⠼⠁⠌⠁⠚⠂⠚⠚⠚⠀⠨⠍");
}
#[test]
fn expr_3_1_1_spaces() {
let expr = "";
test_braille_prefs("UEB", vec![("UEB_UseSpacesAroundAllOperators", "true")], expr, "⠼⠉⠀⠐⠖⠀⠼⠑⠀⠐⠶⠀⠼⠓");
}
#[test]
fn expr_3_1_2_spaces() {
let expr = "";
test_braille_prefs("UEB", vec![("UEB_UseSpacesAroundAllOperators", "true")], expr, "⠼⠓⠀⠐⠤⠀⠼⠑⠀⠐⠶⠀⠼⠉");
}
#[test]
fn expr_3_1_1() {
let expr = "";
// correct not to use extra spacing
test_braille("UEB", expr, "⠼⠉⠐⠖⠼⠑⠀⠐⠶⠀⠼⠓");
}
#[test]
fn expr_3_1_2() {
let expr = "";
// correct not to use extra spacing
test_braille("UEB", expr, "⠼⠓⠐⠤⠼⠑⠀⠐⠶⠀⠼⠉");
}
#[test]
fn expr_3_1_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠐⠦⠼⠑⠀⠐⠶⠀⠼⠑⠐⠦⠼⠉⠀⠐⠶⠀⠼⠁⠑");
}
#[test]
fn expr_3_1_6() {
// example includes spaces, so does the MathML (from WIRIS)
let expr = "";
test_braille("UEB", expr, "⠼⠑⠲⠛⠃⠀⠍⠐⠌⠼⠁⠚⠀⠐⠶⠀⠼⠑⠛⠲⠃⠀⠉⠍");
}
#[test]
fn expr_3_1_7() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠑⠸⠖⠼⠚⠲⠑");
}
#[test]
fn expr_3_1_8() {
let expr = "";
test_braille("UEB", expr, "⠠⠜⠑⠁⠀⠐⠶⠀⠃⠓⠀⠐⠶⠀⠼⠑⠐⠲⠼⠉⠀⠐⠶⠀⠼⠁⠑");
}
#[test]
fn expr_3_1_9_wiris() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠲⠊⠐⠦⠼⠙⠲⠁⠀⠸⠔⠀⠼⠁⠋");
}
#[test]
fn expr_3_1_9() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠲⠊⠐⠦⠼⠙⠲⠁⠀⠸⠔⠀⠼⠁⠋");
}
#[test]
fn expr_3_1_10() {
let expr = "";
test_braille("UEB", expr, "⠼⠑⠐⠤⠼⠉⠀⠐⠶⠈⠱⠀⠼⠉⠐⠤⠼⠑");
}
#[test]
fn ratio_3_1_11() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠒⠼⠃⠚⠚");
}
#[test]
fn ratio_3_1_12() {
let expr = "";
test_braille("UEB", expr, "⠼⠃⠒⠼⠙⠀⠐⠶⠀⠼⠋⠒⠼⠁⠃");
}
#[test]
fn alg_3_2_1_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠽⠀⠸⠐⠶⠀⠰⠭");
}
#[test]
fn alg_3_2_1_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠽⠀⠐⠶⠀⠅⠭");
}
#[test]
fn alg_3_2_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠀⠸⠈⠣⠀⠨⠹⠀⠸⠈⠣⠀⠼⠃⠨⠏");
}
#[test]
fn alg_3_2_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠽⠀⠐⠶⠀⠭⠐⠖⠼⠙");
}
#[test]
fn alg_3_2_4() {
let expr = "";
test_braille("UEB", expr, "⠼⠃⠽⠀⠐⠶⠀⠼⠃⠰⠉⠐⠤⠼⠙");
}
#[test]
fn alg_3_2_5() {
let expr = "";
// BANA says use a word indicator if G1 not in first 3 cells (it is after the '='); use passage if >=2 whitespace
// This seems like a poor choice in this case since there is only one G1 indicator, but that's the BANA guidance so...
// "⠰⠰⠰⠙⠐⠖⠁⠃⠀⠐⠶⠀⠁⠉⠰⠄"
// GTM says to use the following and it is more sensisble, so I'm going with it
test_braille("UEB", expr, "⠙⠐⠖⠁⠃⠀⠐⠶⠀⠰⠁⠉");
}
#[test]
fn ratio_3_2_6() {
// the difference from ratio_3_1_12 is this involves letters
let expr = "";
test_braille("UEB", expr, "⠭⠰⠒⠽");
}
#[test]
fn standing_alone_1() {
// Tests bug: github.com/NSoiffer/MathCAT/issues/142
let expr = "";
test_braille("UEB", expr, "⠐⠣⠰⠝⠀⠐⠶⠀⠼⠛⠐⠜");
}
#[test]
fn example_3_4_1() {
let expr = "";
test_braille("UEB", expr, "⠐⠤⠼⠙⠀⠞⠕⠀⠐⠖⠼⠑");
}
#[test]
fn example_3_4_2() {
// removed some cruft from TeX output of {}^{-}2+{}^{+}3, but the basics are preserved
let expr = "";
test_braille("UEB", expr, "⠰⠔⠐⠤⠼⠃⠐⠖⠔⠐⠤⠼⠉");
}
#[test]
fn omission_3_6_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠐⠖⠼⠛⠀⠐⠶⠀⠐⠠⠤");
}
#[test]
fn omission_3_6_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠐⠖⠼⠛⠀⠐⠶⠀⠨⠤");
}
#[test]
fn omission_3_6_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠐⠖⠼⠛⠀⠐⠶⠀⠰⠦");
}
#[test]
fn omission_3_6_4() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠫⠼⠙⠱⠼⠛⠀⠐⠶⠀⠼⠁⠚");
}
#[test]
fn omission_3_6_5() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠬⠼⠛⠀⠐⠶⠀⠼⠁⠚");
}
#[test]
fn omission_3_6_6() {
// comes from WIRIS
let expr = "";
test_braille("UEB", expr, "⠼⠊⠌⠁⠃⠀⠐⠶⠀⠰⠷⠼⠉⠨⠌⠬⠾");
}
#[test]
fn omission_3_6_7() {
// comes from MathType
let expr = "";
test_braille("UEB", expr, "⠼⠑⠀⠐⠶⠀⠰⠰⠩⠬⠬");
}
#[test]
fn fraction_6_1_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠑⠌⠓");
}
#[test]
fn fraction_6_1_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠑⠲⠛⠌⠃⠂⠚⠚⠚");
}
#[test]
fn fraction_6_2_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠃⠼⠁⠌⠃");
}
#[test]
fn fraction_6_2_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠛⠑⠚⠀⠉⠍⠀⠐⠶⠀⠼⠁⠼⠉⠌⠙⠀⠰⠍");
}
#[test]
fn fraction_6_2_2_unicode_frac() {
let expr = "";
test_braille("UEB", expr, "⠼⠁⠛⠑⠚⠀⠉⠍⠀⠐⠶⠀⠼⠁⠼⠉⠌⠙⠀⠰⠍");
}
#[test]
fn fraction_6_3_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠸⠌⠼⠓");
}
#[test]
fn fraction_6_4_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠽⠀⠐⠶⠀⠷⠭⠨⠌⠼⠃⠾⠰⠄");
}
#[test]
fn fraction_6_4_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠷⠼⠃⠼⠁⠌⠃⠨⠌⠭⠐⠖⠽⠾");
}
#[test]
fn fraction_6_4_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠷⠼⠃⠸⠌⠼⠉⠨⠌⠼⠑⠾");
}
#[test]
fn fraction_6_4_4() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠷⠭⠨⠌⠼⠃⠾⠐⠖⠷⠽⠨⠌⠼⠉⠾⠨⠌⠭⠐⠖⠽⠾");
}
#[test]
fn fraction_6_4_5() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠷⠭⠨⠌⠼⠃⠾⠐⠖⠷⠽⠨⠌⠼⠉⠾⠨⠌⠭⠐⠖⠽⠾");
}
#[test]
fn fraction_6_4_6() {
let expr = "";
// GTM lists two options: "⠎⠏⠑⠫⠀⠐⠶⠀⠰⠰⠷⠙⠊⠎⠞⠁⠝⠉⠑⠨⠌⠞⠊⠍⠑⠾" and "⠰⠰⠰⠎⠏⠑⠑⠙⠀⠐⠶⠀⠷⠙⠊⠎⠞⠁⠝⠉⠑⠨⠌⠞⠊⠍⠑⠾⠰⠄"
test_braille("UEB", expr, "⠎⠏⠑⠫⠀⠐⠶⠀⠰⠰⠷⠙⠊⠎⠞⠁⠝⠉⠑⠨⠌⠞⠊⠍⠑⠾");
}
#[test]
fn msup_7_3_2() {
let expr = "";
test_braille("UEB", expr, "⠭⠰⠔⠼⠃⠽");
}
#[test]
fn msup_7_3_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠭⠔⠣⠼⠃⠽⠜");
}
#[test]
fn msup_7_3_4() {
let expr = "";
test_braille("UEB", expr, "⠭⠰⠔⠽⠐⠖⠼⠁");
}
#[test]
fn msup_7_3_6() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠭⠔⠣⠽⠐⠖⠼⠁⠜⠐⠖⠼⠉");
}
#[test]
fn msup_7_3_7() {
let expr = "";
test_braille("UEB", expr, "⠭⠰⠔⠼⠃⠌⠉");
}
#[test]
fn msup_7_3_11() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠭⠔⠷⠁⠨⠌⠃⠾⠽⠀⠐⠶⠀⠭⠰⠄");
}
#[test]
fn msup_7_4_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠑⠔⠣⠭⠔⠼⠃⠜");
}
#[test]
fn msup_7_4_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠑⠔⠐⠣⠭⠔⠼⠃⠐⠜");
}
#[test]
fn msub_7_4_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠠⠏⠢⠣⠭⠢⠊⠜");
}
#[test]
fn msup_7_5_1() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠲⠚⠚⠙⠑⠀⠐⠶⠀⠼⠙⠲⠑⠐⠦⠼⠁⠚⠔⠣⠐⠤⠼⠉⠜");
}
#[test]
fn msup_7_5_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠁⠔⠣⠐⠤⠼⠃⠰⠃⠜");
}
#[test]
fn msup_7_6_2() {
let expr = "";
test_braille("UEB", expr, "⠠⠓⠰⠔⠐⠖");
}
#[test]
fn msubsup_7_7_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠭⠢⠼⠁⠔⠼⠃⠀⠐⠶⠀⠽⠢⠼⠃⠔⠼⠉⠰⠄");
}
#[test]
fn msubsup_7_7_2() {
let expr = "";
test_braille("UEB", expr, "⠭⠰⠔⠼⠃⠢⠅");
}
#[test]
fn pre_msubsup_7_8_1() {
// Note: modified because word indicator is not needed
let expr = "";
test_braille("UEB", expr, "⠰⠢⠼⠊⠃⠔⠼⠃⠉⠓⠠⠥");
}
#[test]
fn pre_sup_7_8_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠔⠐⠤⠼⠃⠐⠖⠔⠐⠤⠼⠉⠀⠐⠶⠀⠔⠐⠤⠼⠑⠰⠄");
}
#[test]
fn sum_7_9_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠠⠨⠎⠨⠢⠣⠭⠐⠶⠼⠁⠜⠨⠔⠝⠭⠢⠊⠔⠼⠃");
}
#[test]
fn lim_7_9_2() {
// Note: modified because passage indicator is not needed (same expr when word indicator is used)
let expr = "";
test_braille("UEB", expr, "⠰⠰⠇⠊⠍⠨⠢⠣⠭⠳⠕⠁⠜⠋⠐⠣⠭⠐⠜⠀⠐⠶⠀⠼⠁");
}
#[test]
fn sqrt_8_1_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠩⠼⠊⠬⠀⠐⠶⠀⠼⠉");
}
#[test]
fn sqrt_8_1_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠗⠀⠐⠶⠀⠩⠭⠔⠼⠃⠐⠖⠽⠔⠼⠃⠬⠰⠄");
}
#[test]
fn sqrt_8_1_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠩⠷⠼⠛⠓⠉⠲⠃⠐⠦⠼⠋⠲⠑⠙⠛⠨⠌⠼⠚⠲⠙⠋⠃⠓⠾⠬");
}
#[test]
fn sqrt_8_1_4() {
let expr = "
";
test_braille("UEB", expr, "⠰⠰⠰⠭⠀⠐⠶⠀⠷⠐⠤⠃⠸⠖⠩⠃⠔⠼⠃⠐⠤⠼⠙⠰⠁⠉⠬⠨⠌⠼⠃⠰⠁⠾⠰⠄");
}
#[test]
fn root_8_2_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠩⠔⠼⠉⠼⠓⠬⠀⠐⠶⠀⠼⠃");
}
#[test]
fn root_8_2_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠟⠀⠐⠶⠀⠩⠔⠼⠉⠭⠔⠼⠉⠐⠖⠽⠔⠼⠉⠐⠖⠵⠔⠼⠉⠬⠰⠄");
}
#[test]
fn root_8_2_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠩⠔⠣⠍⠝⠜⠭⠽⠬");
}
#[test]
fn root_8_2_4() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠼⠓⠁⠔⠼⠉⠌⠙⠀⠐⠶⠀⠐⠣⠩⠔⠼⠙⠼⠓⠁⠬⠐⠜⠔⠼⠉⠀⠐⠶⠀⠐⠣⠩⠩⠼⠓⠁⠬⠬⠐⠜⠔⠼⠉⠀⠐⠶⠀⠐⠣⠩⠼⠊⠬⠐⠜⠔⠼⠉⠀⠐⠶⠀⠼⠉⠔⠼⠉⠀⠐⠶⠀⠼⠃⠛⠰⠄");
}
#[test]
fn root_letter_base() {
// none of the guides cover this case, but it seems that an a-j base needs a grade 1 indicator
let expr = "";
test_braille("UEB", expr, "⠰⠰⠩⠔⠼⠉⠰⠃⠬⠩⠔⠼⠉⠭⠬");
}
#[test]
fn spacing_9_3_1_1() {
let expr = "";
test_braille("UEB", expr, "⠠⠎⠔⠼⠉⠚");
}
#[test]
fn spacing_9_3_1_2() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠞⠁⠝⠼⠙⠑⠘⠚");
}
#[test]
fn spacing_9_3_1_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠙⠰⠉⠕⠎⠼⠑⠭");
}
#[test]
fn spacing_9_3_2_1() {
let expr = "";
test_braille("UEB", expr, "⠇⠕⠛⠀⠰⠽");
}
#[test]
fn spacing_9_3_2_2() {
let expr = "";
test_braille("UEB", expr, "⠎⠔⠨⠹");
}
#[test]
fn spacing_9_3_2_3() {
let expr = "";
test_braille("UEB", expr, "⠠⠎⠑⠉⠠⠁");
}
#[test]
fn spacing_9_3_2_4() {
let expr = "";
test_braille("UEB", expr, "⠇⠕⠛⠐⠣⠭⠐⠖⠽⠐⠜");
}
#[test]
fn spacing_9_3_2_5() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠠⠇⠊⠍⠷⠭⠨⠌⠼⠃⠾");
}
#[test]
fn spacing_9_3_3_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠭⠀⠎⠔⠼⠋⠚");
}
#[test]
fn spacing_9_3_3_2() {
let expr = "";
test_braille("UEB", expr, "⠭⠠⠎⠔⠼⠋⠚");
}
#[test]
fn spacing_9_3_3_3() {
let expr = "";
test_braille("UEB", expr, "⠰⠠⠭⠀⠇⠕⠛⠀⠰⠽");
}
#[test]
fn spacing_9_3_3_4() {
let expr = "";
test_braille("UEB", expr, "⠭⠠⠇⠕⠛⠀⠰⠽");
}
#[test]
fn spacing_9_3_3_5() {
let expr = "";
test_braille("UEB", expr, "⠎⠔⠐⠣⠠⠁⠐⠖⠠⠃⠐⠜⠀⠐⠶⠀⠎⠔⠠⠁⠀⠉⠕⠎⠠⠃⠐⠖⠉⠕⠎⠠⠁⠀⠎⠔⠠⠃");
}
#[test]
fn spacing_9_3_3_6() {
let expr = "";
test_braille("UEB", expr, "⠎⠔⠼⠃⠨⠃⠀⠐⠶⠀⠼⠃⠎⠊⠝⠨⠃⠉⠕⠎⠨⠃");
}
#[test]
fn text_9_7_1_mtext() {
let expr = "";
test_braille("UEB", expr, "⠠⠏⠗⠐⠣⠠⠁⠀⠯⠀⠰⠠⠃⠐⠜⠀⠐⠶⠀⠠⠏⠗⠠⠁⠐⠖⠠⠏⠗⠠⠃");
}
#[test]
fn text_9_7_1() {
// ugly as the MathML is with non-breaking space in mo's, this is a WIRIS editor output
let expr = "";
test_braille("UEB", expr, "⠠⠏⠗⠐⠣⠠⠁⠀⠯⠀⠰⠠⠃⠐⠜⠀⠐⠶⠀⠠⠏⠗⠠⠁⠐⠖⠠⠏⠗⠠⠃");
}
#[test]
fn stat_9_7_2() {
let expr = "";
// GTM uses "⠰⠰⠰⠠⠑⠭⠏⠐⠣⠠⠗⠐⠜⠀⠐⠶⠀⠷⠝⠨⠌⠼⠃⠾⠐⠖⠼⠁⠰⠄",
// but "⠠⠑⠭⠏⠐⠣⠠⠗⠐⠜⠀⠐⠶⠀⠰⠰⠷⠝⠨⠌⠼⠃⠾⠐⠖⠼⠁" is shorter and is consistent with omission_3_6_7 and fraction_6_4_6
test_braille("UEB", expr, "⠠⠑⠭⠏⠐⠣⠠⠗⠐⠜⠀⠐⠶⠀⠰⠰⠷⠝⠨⠌⠼⠃⠾⠐⠖⠼⠁");
}
#[test]
fn set_10_1() {
let expr = "";
test_braille("UEB", expr, "⠠⠁⠀⠐⠶⠀⠸⠣⠼⠁⠂⠀⠼⠃⠂⠀⠼⠉⠂⠀⠼⠙⠸⠜");
}
#[test]
fn set_10_3() {
let expr = "";
test_braille("UEB", expr, "⠼⠉⠀⠘⠑⠀⠠⠁⠨⠦⠠⠃");
}
#[test]
fn set_10_4() {
let expr = "";
test_braille("UEB", expr, "⠠⠁⠨⠦⠠⠃⠀⠘⠣⠀⠠⠁⠨⠖⠠⠃");
}
#[test]
fn set_10_5() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠠⠁⠶⠨⠖⠠⠃⠶⠀⠐⠶⠀⠐⠣⠠⠁⠨⠦⠠⠃⠐⠜⠶⠰⠄");
}
#[test]
fn set_10_6() {
// Note: example uses the wrong char "├" in the display -- should be "⊢"
let expr = "";
// Acceptable: GTM does uses a G1 passage indicator: "⠰⠰⠰⠨⠣⠐⠣⠏⠈⠖⠟⠐⠜⠈⠦⠈⠹⠏⠨⠜⠀⠸⠒⠀⠟⠰⠄"
// However, the BANA G1 standing alone rule ("...before a single letter standing alone") applies, so start in G2 mode.
// Corrected to remove the passage indicator
test_braille("UEB", expr, "⠨⠣⠐⠣⠏⠈⠖⠟⠐⠜⠈⠦⠈⠹⠏⠨⠜⠀⠸⠒⠀⠰⠟");
}
#[test]
fn example_11_5_1_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠙⠽⠨⠌⠙⠭⠾");
}
#[test]
fn example_11_5_1_3() {
let expr = "";
// Acceptable: GTM uses a G1 start indicator: "⠰⠰⠋⠶⠐⠣⠭⠐⠜"
// However, BANA says don't use a word indicator if G1 is in first 3 cells (the ':' needs it)
// Corrected to avoid word indicator
test_braille("UEB", expr, "⠋⠰⠶⠐⠣⠭⠐⠜");
}
#[test]
fn example_11_5_1_4() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠷⠈⠙⠽⠨⠌⠈⠙⠭⠾");
}
#[test]
fn example_11_5_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠮⠢⠼⠃⠔⠼⠉⠐⠣⠼⠃⠭⠐⠖⠼⠁⠐⠜⠙⠭⠀⠐⠶⠀⠨⠣⠭⠔⠼⠃⠐⠖⠭⠨⠜⠢⠼⠃⠔⠼⠉⠀⠐⠶⠀⠐⠣⠼⠉⠔⠼⠃⠐⠖⠼⠉⠐⠜⠐⠤⠐⠣⠼⠃⠔⠼⠃⠐⠖⠼⠃⠐⠜⠀⠐⠶⠀⠼⠁⠃⠐⠤⠼⠋⠀⠐⠶⠀⠼⠋⠰⠄");
}
#[test]
fn example_11_5_3() {
// from MathJaX
let expr = "";
// modified to use "shape" as recommended in a comment on this example
test_braille("UEB", expr, "⠰⠰⠰⠔⠝⠠⠉⠢⠗⠀⠐⠶⠀⠐⠣⠝⠰⠻⠗⠐⠜⠀⠐⠶⠀⠷⠝⠖⠨⠌⠗⠖⠐⠣⠝⠐⠤⠗⠐⠜⠖⠾⠰⠄");
}
#[test]
fn example_11_5_4() {
let expr = "";
test_braille("UEB", expr, "⠁⠐⠔⠐⠣⠃⠐⠴⠉⠐⠜⠀⠐⠶⠀⠐⠣⠁⠐⠔⠃⠐⠜⠐⠴⠐⠣⠁⠐⠔⠉⠐⠜");
}
#[test]
fn example_11_5_5_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠋⠔⠣⠐⠤⠼⠁⠜⠒⠀⠠⠽⠀⠳⠕⠀⠠⠭⠰⠄");
}
#[test]
fn example_11_5_5_3() {
// this comes from MathJax
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠘⠁⠽⠀⠘⠑⠀⠠⠽⠀⠘⠢⠭⠀⠘⠑⠀⠠⠭⠰⠄");
}
#[test]
fn example_11_5_6() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠸⠣⠐⠣⠭⠂⠀⠽⠐⠜⠀⠸⠳⠀⠭⠐⠖⠽⠀⠐⠶⠀⠼⠋⠸⠜⠰⠄");
}
#[test]
fn example_11_6_math_variant() {
let expr = "";
test_braille("UEB", expr, "⠈⠆⠰⠠⠗");
}
#[test]
fn example_11_6() {
let expr = "";
test_braille("UEB", expr, "⠈⠆⠰⠠⠗");
}
#[test]
fn bar_over_12_1_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠰⠭⠱⠀⠐⠶⠀⠷⠼⠁⠚⠐⠖⠼⠁⠁⠐⠖⠼⠁⠃⠨⠌⠼⠉⠾⠰⠄");
}
#[test]
fn bar_under_12_1_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠣⠭⠐⠖⠽⠜⠠⠱");
}
#[test]
fn bar_menclose_12_1_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠣⠭⠐⠖⠽⠜⠠⠱");
}
#[test]
fn dot_12_1_4() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠲⠣⠼⠉⠜⠘⠲");
}
#[test]
fn dot_12_1_5() {
let expr = "";
test_braille("UEB", expr, "⠼⠚⠲⠑⠋⠣⠼⠁⠜⠘⠲⠼⠃⠣⠼⠉⠜⠘⠲");
}
#[test]
fn dot_12_1_6_single() {
let expr = "";
test_braille("UEB", expr, "⠭⠘⠲");
}
#[test]
fn dot_12_1_6_double() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠭⠨⠔⠣⠲⠲⠜");
}
#[test]
fn hat_12_1_7() {
let expr = "";
// Acceptable: GTM uses a G1 start indicator: "⠰⠰⠠⠁⠠⠃⠐⠱⠠⠉"
// BANA says use a word indicator if G1 not in first 3 cells (modified it to not count cap indicators since that helps with GTM compatibility)
// Corrected to skip the G1 indicator at the start (it's debatable as to which is better)
test_braille("UEB", expr, "⠠⠁⠠⠃⠰⠐⠱⠠⠉");
}
#[test]
fn arrow_over_12() {
// This comes from https://uebonline.org/wp-content/uploads/2021/05/Unified-English-Braille-Extension-Maths-Training-Manual-First-Edition-Rev-4.pdf
let expr = "";
test_braille("UEB", expr, "⠭⠰⠘⠱");
}
#[test]
fn arrow_under_12() {
// This comes from https://uebonline.org/wp-content/uploads/2021/05/Unified-English-Braille-Extension-Maths-Training-Manual-First-Edition-Rev-4.pdf
let expr = "";
test_braille("UEB", expr, "⠭⠰⠠⠘⠱");
}
#[test]
fn bar_12_2_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠭⠔⠣⠽⠱⠜");
}
#[test]
fn bar_12_2_2() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠣⠭⠔⠽⠜⠱");
}
#[test]
fn shape_14_1_1_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠫⠼⠉⠀⠠⠠⠁⠃⠉");
}
#[test]
fn shape_14_1_2_1() {
let expr = "";
test_braille("UEB", expr, "⠰⠫⠼⠉⠱⠠⠠⠁⠃⠉");
}
#[test]
fn shape_14_1_2_2() {
// the for the shapes are wrong -- but it isn't clear what they should be (from WIRIS editor)
let expr = "";
test_braille("UEB", expr, "⠸⠣⠰⠫⠼⠙⠱⠂⠀⠨⠫⠿⠱⠂⠀⠸⠫⠼⠉⠱⠂⠀⠨⠫⠼⠙⠀⠲⠲⠲⠸⠜");
}
#[test]
fn binomial_14_3_3_2() {
let expr = "";
test_braille("UEB", expr, "⠐⠣⠝⠰⠻⠗⠐⠜");
}
#[test]
fn binomial_14_3_3_2_mtable() {
let expr = "";
test_braille("UEB", expr, "⠐⠣⠝⠰⠻⠗⠐⠜");
}
#[test]
fn chem_16_2_8() {
let expr = "";
// Acceptable: GTM does not use a G1 start indicator: "⠠⠉⠁⠐⠣⠠⠕⠠⠓⠐⠜⠰⠢⠼⠃"
// However, BANA says use a word indicator if G1 not in first 3 cells (it is before the subscript near the end); use passage if >=2 whitespace
// This seems like a debateable choice in this case since there is only one G1 indicator, but that's the BANA guidance so...
// Corrected to use word indicator
test_braille("UEB", expr, "⠰⠰⠠⠉⠁⠐⠣⠠⠕⠠⠓⠐⠜⠢⠼⠃");
}
#[test]
fn chem_16_2_9() {
// from mhchem -- \ce{CuSO4·5H2O}
let expr = "";
// Acceptable: GTM does not use a G1 start indicator: "⠠⠉⠥⠠⠎⠠⠕⠰⠢⠼⠙⠐⠲⠼⠑⠠⠓⠢⠼⠃⠠⠕"
// However, BANA says use a word indicator if G1 not in first 3 cells (it is before the subscript); use passage if >=2 whitespace
// This seems like a debatable choice in this case since there is only one G1 indicator, but that's the BANA guidance so...
// Corrected to use word indicator
test_braille("UEB", expr, "⠰⠰⠠⠉⠥⠠⠎⠠⠕⠢⠼⠙⠐⠲⠼⠑⠠⠓⠢⠼⠃⠠⠕");
}
#[test]
fn chem_16_2_10() {
let expr = "";
test_braille("UEB", expr, "⠠⠓⠰⠔⠐⠖");
}
#[test]
fn chem_16_2_11() {
let expr = "";
test_braille("UEB", expr, "⠠⠎⠠⠕⠰⠢⠼⠙⠔⠣⠐⠤⠐⠤⠜");
}
#[test]
fn chem_16_2_12() {
// from MathJax/mhchem V3
let expr = "";
// GTM uses G2 mode and has two G1 indicators (in middle and near end). That definitely violates BANA guidelines and maybe there guidelines.
// I have switched it to G1 word mode, which seems better (same length, but no switching)
test_braille("UEB", expr, "⠰⠰⠠⠠⠠⠗⠐⠲⠉⠓⠐⠣⠕⠓⠐⠜⠐⠲⠉⠓⠢⠼⠃⠐⠲⠉⠓⠢⠼⠃⠐⠲⠉⠕⠢⠼⠃⠰⠓⠠⠄");
}
#[test]
fn chem_16_2_13() {
let expr = "";
test_braille("UEB", expr, "⠰⠰⠠⠋⠑⠔⠣⠠⠠⠊⠊⠊⠜⠠⠉⠇⠢⠼⠉");
}
#[test]
fn chem_16_3_1() {
// see also pre_msubsup_7_8_1 which uses mmultiscripts
// from MathJax
let expr = "";
test_braille("UEB", expr, "⠰⠢⠼⠊⠃⠔⠼⠃⠉⠓⠠⠥");
}
#[test]
fn chem_16_4_2() {
// from MathJax
let expr = r#""#;
test_braille("UEB", expr, "⠰⠔⠼⠁⠠⠎⠢⠼⠚");
}
#[test]
fn chem_16_4_3() {
// from MathJax using \mathrm{}
let expr = r#""#;
test_braille("UEB", expr, "⠼⠙⠰⠙⠔⠼⠊⠼⠑⠎⠔⠼⠃⠀⠰⠔⠼⠃⠠⠙⠢⠣⠼⠑⠸⠌⠼⠃⠜");
}
#[test]
fn chem_16_5_1() {
// from MathJax v3 mhchem, but substituted short arrow because that is what example uses (although it shouldn't)
let expr = r#"
"#;
test_braille("UEB", expr, "⠰⠰⠰⠼⠃⠠⠝⠁⠠⠕⠠⠓⠐⠖⠠⠓⠢⠼⠃⠠⠎⠠⠕⠢⠼⠙⠀⠳⠕⠀⠠⠝⠁⠢⠼⠃⠠⠎⠠⠕⠢⠼⠙⠐⠖⠼⠃⠠⠓⠢⠼⠃⠠⠕⠰⠄");
}
#[test]
fn chem_16_5_2() {
// from WIRIS
let expr = r#"
"#;
// GTM has the order be over followed by under. This is opposite of what is shown in 7.9 (which are large op examples).
// I have spoken with several people about this, including ICEB committee members who all feel this example is a mistake.
// I have adjusted the expected output
test_braille("UEB", expr, "⠰⠰⠰⠠⠝⠢⠼⠃⠀⠳⠕⠨⠢⠣⠠⠓⠁⠃⠑⠗⠀⠏⠗⠕⠉⠑⠎⠎⠜⠨⠔⠣⠠⠓⠢⠼⠃⠜⠀⠠⠝⠠⠓⠢⠼⠉⠰⠄");
}
#[test]
fn chem_16_5_3() {
// from MathJax v3 mhchem, uses "\;" before parens because example adds a space there (although it shouldn't)
let expr = r#"
"#;
test_braille("UEB", expr, "⠰⠰⠰⠠⠓⠢⠼⠃⠀⠐⠣⠛⠐⠜⠐⠖⠠⠊⠢⠼⠃⠀⠐⠣⠎⠐⠜⠀⠐⠶⠀⠼⠃⠠⠓⠠⠊⠀⠐⠣⠛⠐⠜⠰⠄");
}
#[test]
fn chem_16_5_4() {
// from MathJax v4 mhchem, but substituted short arrow because that is what example uses (although it shouldn't)
let expr = r#"
"#;
test_braille("UEB", expr, "⠰⠰⠰⠠⠠⠠⠓⠝⠉⠕⠐⠖⠗⠕⠓⠀⠳⠕⠀⠝⠓⠢⠼⠃⠐⠲⠉⠕⠐⠲⠕⠗⠀⠳⠕⠀⠝⠓⠢⠼⠃⠰⠉⠕⠐⠲⠝⠓⠐⠲⠉⠕⠢⠼⠃⠗⠠⠄⠰⠄");
}
#[test]
fn chem_16_5_5() {
// from MathJax v3 mhchem
let expr = r#"
"#;
test_braille("UEB", expr, "⠰⠰⠰⠠⠏⠃⠔⠣⠐⠖⠐⠖⠜⠐⠖⠼⠃⠰⠑⠀⠘⠸⠶⠀⠠⠏⠃⠰⠄");
}