diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-06-26 13:06:47 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-06-26 13:06:47 -0400 |
| commit | 8a4d5dc57b14e7c947c25970bb4d4f4ef91450f4 (patch) | |
| tree | e36042760c7c22d5a08777939484c06830d73404 /test | |
| parent | c2653404944dbd5a6f737877f0bad6fd1de018f1 (diff) | |
Add get_bit() method for Ints and Bytes
Diffstat (limited to 'test')
| -rw-r--r-- | test/bytes.tm | 9 | ||||
| -rw-r--r-- | test/integers.tm | 18 |
2 files changed, 27 insertions, 0 deletions
diff --git a/test/bytes.tm b/test/bytes.tm index 25efbeb8..a207c633 100644 --- a/test/bytes.tm +++ b/test/bytes.tm @@ -14,3 +14,12 @@ func main() = "0x0F" >> b.hex(uppercase=no) = "0f" + + >> Byte(0x06).get_bit(1) + = no + >> Byte(0x06).get_bit(2) + = yes + >> Byte(0x06).get_bit(3) + = yes + >> Byte(0x06).get_bit(4) + = no diff --git a/test/integers.tm b/test/integers.tm index 6ba1559c..3035ad3b 100644 --- a/test/integers.tm +++ b/test/integers.tm @@ -139,3 +139,21 @@ func main() = yes >> (3).is_between(100, 200) = no + + >> (6).get_bit(1) + = no + >> (6).get_bit(2) + = yes + >> (6).get_bit(3) + = yes + >> (6).get_bit(4) + = no + + >> Int64(6).get_bit(1) + = no + >> Int64(6).get_bit(2) + = yes + >> Int64(6).get_bit(3) + = yes + >> Int64(6).get_bit(4) + = no |
