Skip to content

Commit

Permalink
test: Add right bitshift tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Syndamia committed Nov 6, 2024
1 parent 55f3548 commit 0d23d86
Show file tree
Hide file tree
Showing 15 changed files with 84 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "right_shift_signed_const"
type = "bin"
authors = [""]
compiler_version = ">=0.22.0"
version = "1.0.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a = "-760"
b = "-95"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main(
a: i16,
b: i16,
) {
assert((a >> 3) == b);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "right_shift_const_unsigned"
type = "bin"
authors = [""]
compiler_version = ">=0.22.0"
version = "1.0.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a = "3"
b = "71"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main(
a: u8,
b: u16,
) {
assert((568 >> a) == b);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "right_shift_signed_unsigned"
type = "bin"
authors = [""]
compiler_version = ">=0.22.0"
version = "1.0.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a = "-760"
b = "3"
c = "-95"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main(
a: i16,
b: u8,
c: i16,
) {
assert((a >> b) == c);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "right_shift_unsigned_unsigned"
type = "bin"
authors = [""]
compiler_version = ">=0.22.0"
version = "1.0.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a = "568"
b = "3"
c = "71"
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
fn main(
a: u16,
b: u8,
c: u16,
) {
assert((a >> b) == c);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[package]
name = "right_shift_unsigned_const"
type = "bin"
authors = [""]
compiler_version = ">=0.22.0"
version = "1.0.0"

[dependencies]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a = "568"
b = "71"
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
fn main(
a: u16,
b: u16,
) {
assert((a >> 3) == b);
}

0 comments on commit 0d23d86

Please sign in to comment.