2019-08-04 10:16:44 +03:00
|
|
|
const (
|
|
|
|
a = 3
|
2019-08-04 11:18:31 +03:00
|
|
|
u = u64(1)
|
2019-08-04 10:16:44 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
fn test_const() {
|
2019-08-04 11:18:31 +03:00
|
|
|
b := (true && true) || false
|
|
|
|
assert b == true
|
2019-08-04 10:16:44 +03:00
|
|
|
assert a == 3
|
2019-08-04 11:18:31 +03:00
|
|
|
assert u == u64(1)
|
2019-08-04 10:16:44 +03:00
|
|
|
}
|
2019-08-05 17:57:54 +03:00
|
|
|
|
2019-08-12 02:58:08 +03:00
|
|
|
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 i32(1).str() == '1'
|
|
|
|
assert i32(-1).str() == '-1'
|
|
|
|
assert i64(1).str() == '1'
|
|
|
|
assert i64(-1).str() == '-1'
|
|
|
|
|
|
|
|
assert u8(1).str() == '1'
|
|
|
|
assert u8(-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'
|
|
|
|
}
|
|
|
|
|
2019-08-09 11:21:21 +03:00
|
|
|
/*
|
2019-08-05 17:57:54 +03:00
|
|
|
fn test_cmp() {
|
|
|
|
assert 1 ≠ 2
|
|
|
|
assert 1 ⩽ 2
|
|
|
|
assert 1 ⩾ 0
|
|
|
|
}
|
2019-08-09 11:21:21 +03:00
|
|
|
*/
|