// Nemeth tests from the 2023 chemistry spec
// https://www.brailleauthority.org/sites/default/files/chemistry/Chemical%20Notation%20Using%20the%20Nemeth%20Braille%20Code%202023.pdf
// The numbering refers to the sections in that reference.
// The MathML comes from ChemType (basically WIRIS's tweak to the online MathType editor) or mhchem (indicated in test name)
use crate::common::*;
#[test]
fn bond_2_1() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠸⠒⠻⠠⠃⠑⠸⠒⠻⠠⠓");
}
#[test]
fn bond_2_2() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠆⠠⠉⠸⠶⠻⠠⠉⠠⠓⠆");
}
#[test]
fn bond_2_2_mhchem() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠆⠠⠉⠸⠶⠻⠠⠉⠠⠓⠆");
}
#[test]
fn bond_2_3() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠸⠒⠻⠠⠉⠸⠿⠻⠠⠉⠸⠒⠻⠠⠓");
}
#[test]
fn bond_2_5() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠋⠑⠬⠠⠉⠇⠆⠀⠨⠅⠀⠠⠋⠑⠠⠉⠇⠒");
}
// FIX: add tests for 2.2.2: Horizontal Arrow Bonds (these are not currently known by MathCAT)
#[test]
fn arrow_bond_sec_2_2_2_c() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠼⠆⠠⠝⠁⠬⠠⠉⠇⠆⠀⠫⠕⠀⠼⠆⠠⠝⠁⠠⠉⠇");
}
#[test]
fn arrow_bond_sec_2_2_2_d() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠗⠠⠝⠠⠓⠆⠬⠠⠗⠠⠭⠀⠫⠕⠀⠠⠗⠆⠠⠝⠠⠓⠆⠐⠘⠬⠐⠠⠭⠘⠤");
}
#[test]
fn arrow_bond_sec_2_2_2_d_mhchem() {
// changed long right arrow to short right arrow as that is what the example (wrongly) uses
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠗⠠⠝⠠⠓⠆⠬⠠⠗⠠⠭⠀⠫⠕⠀⠠⠗⠆⠠⠝⠠⠓⠆⠐⠘⠬⠐⠠⠭⠘⠤");
}
#[test]
fn lewis_2_20() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠠⠕⠆⠬⠠⠝⠠⠕⠀⠫⠕⠀⠠⠝⠠⠕⠆⠬⠡⠠⠕⠠⠓");
}
#[test]
fn lewis_2_21() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠗⠡⠬⠡⠠⠉⠠⠓⠒⠀⠫⠕⠀⠠⠗⠠⠉⠠⠓⠒");
}
#[test]
fn lewis_2_22() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠈⠷⠠⠉⠠⠓⠒⠈⠾⠡");
}
#[test]
fn dots_2_37_a() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠹⠠⠝⠨⠹⠠⠝⠹");
}
#[test]
fn dots_2_37_b() {
// Note: this uses vertical ellipsis for the triple vertical dot. There is also U+205D, but's pretty ubscure.
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠹⠠⠉⠨⠹⠠⠉⠹⠠⠓");
}
#[test]
fn yields_3_1() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠉⠠⠓⠲⠷⠛⠾⠬⠆⠠⠕⠆⠷⠛⠾⠀⠫⠕⠀⠠⠉⠠⠕⠆⠷⠛⠾⠬⠆⠠⠓⠆⠠⠕⠷⠛⠾");
}
#[test]
fn reverse_3_2() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠝⠆⠬⠒⠠⠓⠆⠀⠫⠪⠒⠒⠀⠼⠆⠠⠝⠠⠓⠒");
}
#[test]
fn reaction_arrow_3_9() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠆⠷⠛⠾⠬⠠⠊⠆⠷⠛⠾⠀⠫⠒⠕⠫⠪⠒⠀⠼⠆⠠⠓⠠⠊⠷⠛⠾");
}
#[test]
fn reaction_arrow_3_13() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠒⠠⠉⠸⠒⠻⠠⠉⠸⠿⠻⠠⠉⠘⠤⠐⠠⠝⠁⠘⠬⠐⠬⠠⠝⠠⠓⠒⠀⠫⠪⠒⠒⠫⠒⠕⠀⠠⠓⠒⠠⠉⠸⠒⠻⠠⠉⠸⠿⠻⠠⠉⠸⠒⠻⠠⠓⠬⠠⠝⠁⠘⠬⠐⠠⠝⠠⠓⠆⠐⠘⠤");
}
#[test]
fn reaction_arrow_3_14_a() {
// Note: this uses an arrow rather than harpoon because Unicode currently lacks the symbol (braille should be the same)
// There's not enough chemistry to pick up (value=3), so intent is added
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠗⠀⠫⠒⠒⠕⠫⠪⠒⠀⠠⠏");
}
#[test]
fn reaction_arrow_3_14_b() {
// Note: this uses an arrow rather than harpoon because Unicode currently lacks the symbol (braille should be the same)
// There's not enough chemistry to pick up (value=3), so intent is added
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠗⠀⠫⠒⠕⠫⠪⠒⠒⠀⠠⠏");
}
#[test]
fn arrow_3_36() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠼⠆⠠⠁⠇⠬⠆⠠⠝⠁⠠⠕⠠⠓⠬⠆⠠⠓⠆⠠⠕⠀⠫⠕⠀⠠⠝⠁⠆⠠⠁⠇⠆⠠⠕⠲⠬⠒⠠⠓⠆⠫⠣");
}
#[test]
fn arrow_3_37() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠉⠁⠷⠠⠓⠠⠉⠠⠕⠒⠾⠰⠆⠐⠬⠠⠉⠁⠷⠠⠕⠠⠓⠾⠰⠆⠀⠫⠕⠀⠼⠆⠠⠉⠁⠠⠉⠠⠕⠒⠫⠩⠀⠬⠆⠠⠓⠆⠠⠕");
}
#[test]
fn dot_4_5() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠅⠂⠈⠷⠠⠏⠠⠉⠇⠢⠈⠾⠀⠨⠅⠀⠠⠅⠆⠈⠷⠠⠏⠠⠉⠇⠒⠈⠾⠡⠈⠷⠠⠉⠇⠆⠈⠾");
}
#[test]
fn charge_5_1_c() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠼⠆⠠⠁⠇⠀⠫⠕⠀⠼⠆⠠⠁⠇⠘⠒⠬⠐⠬⠖⠑⠘⠤");
}
#[test]
fn charge_5_3_a() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠓⠠⠏⠠⠕⠲⠐⠘⠆⠤");
}
#[test]
fn charge_5_3_b() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠰⠆⠘⠲⠐⠠⠓⠑⠘⠆⠬");
}
#[test]
fn simultaneious_scripts_5_8_b() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠎⠠⠕⠲⠘⠆⠤");
}
#[test]
fn staggered_scripts_5_9_a() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠼⠢⠠⠉⠆⠠⠕⠲⠐⠘⠆⠤⠐⠷⠁⠟⠾");
}
#[test]
fn staggered_scripts_5_9_b() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠷⠠⠎⠊⠠⠕⠒⠾⠰⠝⠐⠘⠆⠝⠤");
}
#[test]
fn state_5_10() {
let expr = r#""#;
// the chem book seems to have a bug in using dot 5 in the first delta expr. They have "⠨⠠⠙⠠⠓⠘⠨⠡⠐⠰⠷⠗⠑⠁⠉⠞⠊⠕⠝⠾".
// I sent a bug report in bug haven't heard back. This tests assumes the book has a bug
test_braille("Nemeth", expr, "⠨⠠⠙⠠⠓⠘⠨⠡⠰⠷⠗⠑⠁⠉⠞⠊⠕⠝⠾");
}
#[test]
fn state_as_subscript_5_13() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠠⠎⠝⠘⠆⠬⠐⠷⠁⠟⠾");
}
#[test]
fn prescripts_5_14() {
let expr = r#""#;
test_braille("Nemeth", expr, "⠰⠔⠔⠘⠆⠢⠲⠐⠠⠑⠎⠬⠰⠆⠘⠲⠐⠠⠓⠑⠀⠫⠕⠀⠰⠂⠴⠂⠘⠆⠢⠖⠐⠠⠍⠙⠬⠆⠰⠴⠘⠂⠐⠝");
}