Skip to content

Commit 6d88469

Browse files
author
Ayush Kumar Mishra
committed
Added tests in int module library as a part of rust-lang#76268
1 parent c4f836a commit 6d88469

File tree

4 files changed

+14
-18
lines changed

4 files changed

+14
-18
lines changed

library/core/tests/num/i32.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,8 @@ fn test_arith_operation() {
2828
i32_c + i32_c * 2 / 3 * 2 + (i32_c - 7 % 3)
2929
);
3030
}
31+
32+
#[test]
33+
fn test_sub_operation() {
34+
let mut x: i32 = -400; x = 0 - x; assert_eq!(x, 400);
35+
}

library/core/tests/num/i8.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
11
int_module!(i8, i8);
2+
3+
#[test]
4+
fn test_incr_operation() {
5+
let mut x: i8 = -12;
6+
let y: i8 = -12;
7+
x = x + 1;
8+
x = x - 1;
9+
assert_eq!(x, y);
10+
}

src/test/ui/numbers-arithmetic/i32-sub.rs

Lines changed: 0 additions & 6 deletions
This file was deleted.

src/test/ui/numbers-arithmetic/i8-incr.rs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)