add test for array_repeat with f32/f64
Signed-off-by: Cytown <cytown@gmail.com>pull/984/head^2
parent
fbe8f6c774
commit
fcf8909c75
|
@ -95,6 +95,25 @@ fn test_repeat() {
|
||||||
b := [7; 3]
|
b := [7; 3]
|
||||||
assert b.len == 3
|
assert b.len == 3
|
||||||
assert b[0] == 7 && b[1] == 7 && b[2] == 7
|
assert b[0] == 7 && b[1] == 7 && b[2] == 7
|
||||||
|
{
|
||||||
|
mut aa := [1.1 ; 10]
|
||||||
|
// FIXME: assert aa[0] == 1.1 will fail, need fix
|
||||||
|
assert aa[0] == f32(1.1)
|
||||||
|
assert aa[5] == f32(1.1)
|
||||||
|
assert aa[9] == f32(1.1)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mut aa := [f32(1.1) ; 10]
|
||||||
|
assert aa[0] == f32(1.1)
|
||||||
|
assert aa[5] == f32(1.1)
|
||||||
|
assert aa[9] == f32(1.1)
|
||||||
|
}
|
||||||
|
{
|
||||||
|
mut aa := [f64(1.1) ; 10]
|
||||||
|
assert aa[0] == f64(1.1)
|
||||||
|
assert aa[5] == f64(1.1)
|
||||||
|
assert aa[9] == f64(1.1)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_right() {
|
fn test_right() {
|
||||||
|
|
Loading…
Reference in New Issue