summaryrefslogtreecommitdiffstats
path: root/src/test/ui/numbers-arithmetic/div-mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/numbers-arithmetic/div-mod.rs')
-rw-r--r--src/test/ui/numbers-arithmetic/div-mod.rs19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/test/ui/numbers-arithmetic/div-mod.rs b/src/test/ui/numbers-arithmetic/div-mod.rs
new file mode 100644
index 000000000..acb92a7df
--- /dev/null
+++ b/src/test/ui/numbers-arithmetic/div-mod.rs
@@ -0,0 +1,19 @@
+// run-pass
+
+
+
+
+pub fn main() {
+ let x: isize = 15;
+ let y: isize = 5;
+ assert_eq!(x / 5, 3);
+ assert_eq!(x / 4, 3);
+ assert_eq!(x / 3, 5);
+ assert_eq!(x / y, 3);
+ assert_eq!(15 / y, 3);
+ assert_eq!(x % 5, 0);
+ assert_eq!(x % 4, 3);
+ assert_eq!(x % 3, 0);
+ assert_eq!(x % y, 0);
+ assert_eq!(15 % y, 0);
+}