def test_from_u16_with_positive(): assert from_u16(17) == 17
def test_from_u16_with_zero(): assert from_u16(0) == 0
def test_from_u16_with_another_negative(): assert from_u16(40493) == -25043
def test_from_u16_with_mid_sized_negative(): assert from_u16(63802) == -1734
def test_from_u16_with_max_negative(): assert from_u16(32768) == -32768
def test_from_u16_with_min_negative(): assert from_u16(65535) == -1
def test_stdlib_tstrcmp(): vm = execute_program_helper(helper_stdlib("tstrcmp", "a", "b")) assert from_u16(vm.registers[1]) < 0