1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

fix cmdline_test.v

This commit is contained in:
Alexander Medvednikov 2020-02-18 20:31:08 +01:00
parent 31c1483b9d
commit c314ab7b60
2 changed files with 14 additions and 3 deletions

View File

@ -513,9 +513,6 @@ pub fn (a []i64) eq(a2 []i64) bool {
return array_eq(a, a2)
}
pub fn (a []string) eq(a2 []string) bool {
return array_eq(a, a2)
}
pub fn (a []byte) eq(a2 []byte) bool {
return array_eq(a, a2)
@ -526,6 +523,19 @@ pub fn (a []f32) eq(a2 []f32) bool {
}
*/
pub fn (a1 []string) eq(a2 []string) bool {
//return array_eq(a, a2)
if a1.len != a2.len {
return false
}
for i := 0; i < a1.len; i++ {
if a1[i] != a2[i] {
return false
}
}
return true
}
// compare_i64 for []f64 sort_with_compare()
// sort []i64 with quicksort
// usage :

View File

@ -464,6 +464,7 @@ fn test_map() {
fn test_array_str() {
numbers := [1, 2, 3]
// assert numbers == [1,2,3]
numbers2 := [numbers, [4, 5, 6]] // dup str() bug
assert true
assert numbers.str() == '[1, 2, 3]'