fix tests

pull/1308/head
Alexander Medvednikov 2019-07-25 14:06:26 +02:00
parent 2ad0d0200d
commit ceb0139329
3 changed files with 4 additions and 4 deletions

View File

@ -16,7 +16,7 @@ fn test_ints() {
assert a[4] == 4 assert a[4] == 4
assert a.last() == 4 assert a.last() == 4
mut s := a.str() s := a.str()
assert s == '[1, 5, 2, 3, 4]' assert s == '[1, 5, 2, 3, 4]'
assert a[1] == 5 assert a[1] == 5
assert a.last() == 4 assert a.last() == 4

View File

@ -140,7 +140,7 @@ fn test_clone() {
mut a := 'a' mut a := 'a'
a += 'a' a += 'a'
a += 'a' a += 'a'
mut b := a b := a
mut c := a.clone() mut c := a.clone()
assert c == a assert c == a
assert c == 'aaa' assert c == 'aaa'

View File

@ -2,7 +2,7 @@ import math.stats as stats
fn test_freq() { fn test_freq() {
// Tests were also verified on Wolfram Alpha // Tests were also verified on Wolfram Alpha
mut data := [f64(10.0),f64(10.0),f64(5.9),f64(2.7)] data := [f64(10.0),f64(10.0),f64(5.9),f64(2.7)]
mut o := stats.freq(data,10.0) mut o := stats.freq(data,10.0)
assert o == 2 assert o == 2
o = stats.freq(data,2.7) o = stats.freq(data,2.7)
@ -256,4 +256,4 @@ fn test_passing_empty() {
assert stats.min(data) == f64(0) assert stats.min(data) == f64(0)
assert stats.max(data) == f64(0) assert stats.max(data) == f64(0)
assert stats.range(data) == f64(0) assert stats.range(data) == f64(0)
}