mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
22 lines
716 B
Plaintext
22 lines
716 B
Plaintext
/datum/unit_test/num2hex/start()
|
|
assert_eq(num2hex(0, 1), "0")
|
|
assert_eq(num2hex(1, 1), "1")
|
|
assert_eq(num2hex(15, 1), "F")
|
|
assert_eq(num2hex(16, 1), "0")
|
|
assert_eq(num2hex(0xABCDE, 1), "E")
|
|
assert_eq(num2hex(SHORT_REAL_LIMIT-1, 1), "F")
|
|
|
|
assert_eq(num2hex(0, 2), "00")
|
|
assert_eq(num2hex(1, 2), "01")
|
|
assert_eq(num2hex(15, 2), "0F")
|
|
assert_eq(num2hex(16, 2), "10")
|
|
assert_eq(num2hex(0xABCDE, 2), "DE")
|
|
assert_eq(num2hex(SHORT_REAL_LIMIT-1, 2), "FF")
|
|
|
|
assert_eq(num2hex(0, 8), "00000000")
|
|
assert_eq(num2hex(1, 8), "00000001")
|
|
assert_eq(num2hex(15, 8), "0000000F")
|
|
assert_eq(num2hex(16, 8), "00000010")
|
|
assert_eq(num2hex(0xABCDE, 8), "000ABCDE")
|
|
assert_eq(num2hex(SHORT_REAL_LIMIT-1, 8), "00FFFFFF")
|