MCPcopy Create free account
hub / github.com/daisy/MathCAT / check_answer

Function check_answer

tests/common/mod.rs:38–46  ·  view source on GitHub ↗

used in testing

(test: &str, target: &str, failure_message: &str)

Source from the content-addressed store, hash-verified

36
37#[allow(dead_code)] // used in testing
38fn check_answer(test: &str, target: &str, failure_message: &str) {
39 if let Err(e) = set_mathml(test.to_string()) {
40 panic!("{}", errors_to_string(&e));
41 };
42 match get_spoken_text() {
43 Ok(speech) => assert_eq!(target, strip_spaces(speech), "\ntest with {} failed", failure_message),
44 Err(e) => panic!("{}", errors_to_string(&e)),
45 };
46}
47
48// Compare the result of speaking the mathml input to the output 'speech'
49// This uses default preferences

Callers 2

testFunction · 0.85
test_prefsFunction · 0.85

Calls 2

set_mathmlFunction · 0.85
get_spoken_textFunction · 0.85

Tested by 1

test_prefsFunction · 0.68