mirror of
https://github.com/alexanderepstein/Bash-Snippets
synced 2018-11-08 02:59:35 +01:00
Adding bad input tests to newton
This commit is contained in:
parent
4fc0cb2ff9
commit
c60796282b
@ -23,6 +23,18 @@
|
|||||||
[ "${lines[3]}" = "|Result: 8 x^4 + 28 x^2" ]
|
[ "${lines[3]}" = "|Result: 8 x^4 + 28 x^2" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "Testing newton bad characters in expression " {
|
||||||
|
run newton simplify 3x#
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
[ "${lines[0]}" = "Error: Expression contains invalid characters" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "Testing newton bad operation " {
|
||||||
|
run newton jokes 2x^2
|
||||||
|
[ "$status" -eq 1 ]
|
||||||
|
[ "${lines[0]}" = "Error: invalid operation, run newton -h to get a list of valid operations" ]
|
||||||
|
}
|
||||||
|
|
||||||
@test "Get the tools version with -v" {
|
@test "Get the tools version with -v" {
|
||||||
run newton -v
|
run newton -v
|
||||||
[ "$status" -eq 0 ]
|
[ "$status" -eq 0 ]
|
||||||
|
Loading…
Reference in New Issue
Block a user