@@ -5,110 +5,110 @@ use wordy::*;
55#[ test]
66fn addition ( ) {
77 let command = "What is 1 plus 1?" ;
8- assert_eq ! ( Ok ( 2 ) , WordProblem :: new( command) . answer( ) ) ;
8+ assert_eq ! ( Some ( 2 ) , WordProblem :: new( command) . answer( ) ) ;
99}
1010
1111#[ test]
1212#[ ignore]
1313fn more_addition ( ) {
1414 let command = "What is 53 plus 2?" ;
15- assert_eq ! ( Ok ( 55 ) , WordProblem :: new( command) . answer( ) ) ;
15+ assert_eq ! ( Some ( 55 ) , WordProblem :: new( command) . answer( ) ) ;
1616}
1717
1818#[ test]
1919#[ ignore]
2020fn addition_with_negative_numbers ( ) {
2121 let command = "What is -1 plus -10?" ;
22- assert_eq ! ( Ok ( -11 ) , WordProblem :: new( command) . answer( ) ) ;
22+ assert_eq ! ( Some ( -11 ) , WordProblem :: new( command) . answer( ) ) ;
2323}
2424
2525#[ test]
2626#[ ignore]
2727fn large_addition ( ) {
2828 let command = "What is 123 plus 45678?" ;
29- assert_eq ! ( Ok ( 45801 ) , WordProblem :: new( command) . answer( ) ) ;
29+ assert_eq ! ( Some ( 45801 ) , WordProblem :: new( command) . answer( ) ) ;
3030}
3131
3232#[ test]
3333#[ ignore]
3434fn subtraction ( ) {
3535 let command = "What is 4 minus -12?" ;
36- assert_eq ! ( Ok ( 16 ) , WordProblem :: new( command) . answer( ) ) ;
36+ assert_eq ! ( Some ( 16 ) , WordProblem :: new( command) . answer( ) ) ;
3737}
3838
3939#[ test]
4040#[ ignore]
4141fn multiplication ( ) {
4242 let command = "What is -3 multiplied by 25?" ;
43- assert_eq ! ( Ok ( -75 ) , WordProblem :: new( command) . answer( ) ) ;
43+ assert_eq ! ( Some ( -75 ) , WordProblem :: new( command) . answer( ) ) ;
4444}
4545
4646#[ test]
4747#[ ignore]
4848fn division ( ) {
4949 let command = "What is 33 divided by -3?" ;
50- assert_eq ! ( Ok ( -11 ) , WordProblem :: new( command) . answer( ) ) ;
50+ assert_eq ! ( Some ( -11 ) , WordProblem :: new( command) . answer( ) ) ;
5151}
5252
5353#[ test]
5454#[ ignore]
5555fn multiple_additions ( ) {
5656 let command = "What is 1 plus 1 plus 1?" ;
57- assert_eq ! ( Ok ( 3 ) , WordProblem :: new( command) . answer( ) ) ;
57+ assert_eq ! ( Some ( 3 ) , WordProblem :: new( command) . answer( ) ) ;
5858}
5959
6060#[ test]
6161#[ ignore]
6262fn addition_and_subtraction ( ) {
6363 let command = "What is 1 plus 5 minus -2?" ;
64- assert_eq ! ( Ok ( 8 ) , WordProblem :: new( command) . answer( ) ) ;
64+ assert_eq ! ( Some ( 8 ) , WordProblem :: new( command) . answer( ) ) ;
6565}
6666
6767#[ test]
6868#[ ignore]
6969fn multiple_subtraction ( ) {
7070 let command = "What is 20 minus 4 minus 13?" ;
71- assert_eq ! ( Ok ( 3 ) , WordProblem :: new( command) . answer( ) ) ;
71+ assert_eq ! ( Some ( 3 ) , WordProblem :: new( command) . answer( ) ) ;
7272}
7373
7474#[ test]
7575#[ ignore]
7676fn subtraction_then_addition ( ) {
7777 let command = "What is 17 minus 6 plus 3?" ;
78- assert_eq ! ( Ok ( 14 ) , WordProblem :: new( command) . answer( ) ) ;
78+ assert_eq ! ( Some ( 14 ) , WordProblem :: new( command) . answer( ) ) ;
7979}
8080
8181#[ test]
8282#[ ignore]
8383fn multiple_multiplications ( ) {
8484 let command = "What is 2 multiplied by -2 multiplied by 3?" ;
85- assert_eq ! ( Ok ( -12 ) , WordProblem :: new( command) . answer( ) ) ;
85+ assert_eq ! ( Some ( -12 ) , WordProblem :: new( command) . answer( ) ) ;
8686}
8787
8888#[ test]
8989#[ ignore]
9090fn addition_and_multiplication ( ) {
9191 let command = "What is -3 plus 7 multiplied by -2?" ;
92- assert_eq ! ( Ok ( -8 ) , WordProblem :: new( command) . answer( ) ) ;
92+ assert_eq ! ( Some ( -8 ) , WordProblem :: new( command) . answer( ) ) ;
9393}
9494
9595#[ test]
9696#[ ignore]
9797fn multiple_divisions ( ) {
9898 let command = "What is -12 divided by 2 divided by -3?" ;
99- assert_eq ! ( Ok ( 2 ) , WordProblem :: new( command) . answer( ) ) ;
99+ assert_eq ! ( Some ( 2 ) , WordProblem :: new( command) . answer( ) ) ;
100100}
101101
102102#[ test]
103103#[ ignore]
104104fn unknown_operation ( ) {
105105 let command = "What is 52 cubed?" ;
106- assert ! ( WordProblem :: new( command) . answer( ) . is_err ( ) ) ;
106+ assert ! ( WordProblem :: new( command) . answer( ) . is_none ( ) ) ;
107107}
108108
109109#[ test]
110110#[ ignore]
111111fn non_math_question ( ) {
112112 let command = "Who is the President of the United States?" ;
113- assert ! ( WordProblem :: new( command) . answer( ) . is_err ( ) ) ;
113+ assert ! ( WordProblem :: new( command) . answer( ) . is_none ( ) ) ;
114114}
0 commit comments