/// Tests for fractions
/// includes simple fractions and more complex fractions
/// also tests mixed fractions (implicit and explicit)
use crate::common::*;
#[test]
fn common_fraction_half() {
let expr = "";
test("fi", "SimpleSpeak", expr, "1 kahdesosa");
}
#[test]
fn common_fraction_thirds() {
let expr = "";
test("fi", "SimpleSpeak", expr, "2 kolmasosaa");
}
#[test]
fn common_fraction_tenths() {
let expr = "";
test("fi", "SimpleSpeak", expr, "17 kymmenesosaa");
}
#[test]
#[allow(non_snake_case)]
fn not_SimpleSpeak_common_fraction_tenths() {
let expr = "";
test("fi", "SimpleSpeak", expr, "89 per 10,");
}
#[test]
fn non_simple_fraction() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x plus y, per, x miinus y, loppu murtoluku;");
}
#[test]
fn nested_fraction() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x plus, murtoluku, 1 per y, loppu murtoluku; per, x miinus y, loppu murtoluku;");
}
#[test]
fn deeply_nested_fraction_msqrt() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x plus, neliöjuuri 1 per y, loppu juuri; per, x miinus y, loppu murtoluku;");
}
#[test]
fn deeply_nested_fraction_mrow_msqrt() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x plus, neliöjuuri 2 plus 1 per y, loppu juuri; per, x miinus y, loppu murtoluku;");
}
#[test]
fn numerator_simple_fraction() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x per, x miinus y, loppu murtoluku;");
}
#[test]
fn denominator_simple_fraction() {
let expr = "
";
test("fi", "SimpleSpeak", expr, "murtoluku, x miinus y, per x, loppu murtoluku;");
}
#[test]
fn mixed_number() {
let expr = "";
test("fi", "SimpleSpeak", expr, "3 ja 1 kahdesosa");
}
#[test]
fn explicit_mixed_number() {
let expr = "";
test("fi", "SimpleSpeak", expr, "3 ja 1 kahdeksasosa");
}
#[test]
fn mixed_number_big() {
let expr = "";
test("fi", "SimpleSpeak", expr, "3 ja 7 kahdeksankymmentä kolmasosaa");
}
#[test]
fn simple_text() {
let expr = "";
test("fi", "SimpleSpeak", expr, "osoittaja per nimittäjä,");
}
#[test]
fn number_and_text() {
let expr = "";
test("fi", "SimpleSpeak", expr, "murtoluku, 2 mailia, per, 3 gallonaa, loppu murtoluku;");
}
#[test]
fn nested_simple_fractions() {
let expr = "";
test("fi", "SimpleSpeak", expr, "murtoluku, 1 kahdesosa, per, 2 kolmasosaa, loppu murtoluku;");
}
#[test]
fn binomial() {
let expr = "";
test("fi", "SimpleSpeak", expr, "2 kertaa 7 yli 3");
}