add test for array_repeat with f32/f64

Signed-off-by: Cytown <cytown@gmail.com>
pull/984/head^2
Cytown 2019-07-04 16:46:39 +08:00 committed by Alexander Medvednikov
parent fbe8f6c774
commit fcf8909c75
1 changed files with 19 additions and 0 deletions

View File

@ -95,6 +95,25 @@ fn test_repeat() {
b := [7; 3]
assert b.len == 3
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() {