# HG changeset patch # User Bastien Orivel # Date 1464991181 -7200 # Node ID bc3437ecb12baed1e9d63c3ae9efc7db1b087525 # Parent 4c926e910b805ea25a775f0fbbc649cdfbd74374 Add a test for unaryop and fix ast_dump for unaryop::Not. diff --git a/src/ast_dump.rs b/src/ast_dump.rs --- a/src/ast_dump.rs +++ b/src/ast_dump.rs @@ -35,7 +35,7 @@ impl unaryop { fn to_string(&self) -> &'static str { match *self { unaryop::Invert => "~", - unaryop::Not => "!", + unaryop::Not => "not ", unaryop::UAdd => "+", unaryop::USub => "-" } diff --git a/tests/test_parse_files/test_unaryop.py b/tests/test_parse_files/test_unaryop.py new file mode 100644 --- /dev/null +++ b/tests/test_parse_files/test_unaryop.py @@ -0,0 +1,4 @@ +a = ~5 +a = -5 +a = not False +a = +5