1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/builtin/int_test.v
2019-09-03 15:21:52 +03:00

40 lines
734 B
V

const (
a = 3
u = u64(1)
)
fn test_const() {
b := (true && true) || false
assert b == true
assert a == 3
assert u == u64(1)
}
fn test_str_methods() {
assert i8(1).str() == '1'
assert i8(-1).str() == '-1'
assert i16(1).str() == '1'
assert i16(-1).str() == '-1'
assert int(1).str() == '1'
assert int(-1).str() == '-1'
assert i64(1).str() == '1'
assert i64(-1).str() == '-1'
// assert byte(1).str() == '1'
// assert byte(-1).str() == '255'
assert u16(1).str() == '1'
assert u16(-1).str() == '65535'
assert u32(1).str() == '1'
assert u32(-1).str() == '4294967295'
assert u64(1).str() == '1'
assert u64(-1).str() == '18446744073709551615'
}
/*
fn test_cmp() {
assert 1 ≠ 2
assert 1 ⩽ 2
assert 1 ⩾ 0
}
*/