diff options
Diffstat (limited to 'tests/ui/opeq.rs')
-rw-r--r-- | tests/ui/opeq.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/ui/opeq.rs b/tests/ui/opeq.rs new file mode 100644 index 000000000..9737be97f --- /dev/null +++ b/tests/ui/opeq.rs @@ -0,0 +1,17 @@ +// run-pass + +pub fn main() { + let mut x: isize = 1; + x *= 2; + println!("{}", x); + assert_eq!(x, 2); + x += 3; + println!("{}", x); + assert_eq!(x, 5); + x *= x; + println!("{}", x); + assert_eq!(x, 25); + x /= 5; + println!("{}", x); + assert_eq!(x, 5); +} |