code / tomo

Lines41.3K C23.7K Markdown9.7K YAML5.0K Tomo2.3K
7 others 763
Python231 Shell230 make212 INI47 Text21 SVG16 Lua6
(16 lines)
2 func main()
3 say("Test bytes:")
4 assert Byte(100) == Byte(0x64)
6 assert Byte(0xFF) == Byte(0xFF)
8 >> b := Byte(0x0F)
9 assert b.hex() == "0F"
10 assert b.hex(prefix=yes) == "0x0F"
11 assert b.hex(uppercase=no) == "0f"
13 assert Byte(0x06).get_bit(1) == no
14 assert Byte(0x06).get_bit(2) == yes
15 assert Byte(0x06).get_bit(3) == yes
16 assert Byte(0x06).get_bit(4) == no