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

fix tests

This commit is contained in:
S-YOU 2019-06-27 02:03:35 +09:00 committed by Alexander Medvednikov
parent 2ca6859982
commit d998313bb1
6 changed files with 9 additions and 7 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
*.dSYM
*_test

View File

@ -14,7 +14,7 @@ const (
47, 48, 49, 50, 51]
)
fn decode(data string) string {
pub fn decode(data string) string {
p := data.cstr()
len := data.len
mut pad := 0
@ -25,7 +25,7 @@ fn decode(data string) string {
str_len := L / 4 * 3 + pad
mut str := malloc(str_len + 2)
mut j := 0
for i := 0; i < L; i += 4 {
for i := 0; i < L; i = i+4 {
n := (Index[p[i]] << 18) | (Index[p[i + 1]] << 12) |
(Index[p[i + 2]] << 6) | (Index[p[i + 3]])
str[j] = n >> 16
@ -44,7 +44,7 @@ fn decode(data string) string {
}
}
str[str_len + 1] = `\0`
return tos(str, str_len+2)
return tos(str, str_len+1)
}
const (

View File

@ -289,4 +289,5 @@ fn test_all_after() {
s := 'fn hello'
q := s.all_after('fn ')
assert q == 'hello'
}

View File

@ -8,7 +8,7 @@ v.c:
curl -Os https://raw.githubusercontent.com/vlang/vc/master/v.c
test: v
find .. -name '*_test.v' | xargs ./v {}
find .. -name '*_test.v' -print0 | xargs -0 -n1 ./v
clean:
-rm -f v.c v

View File

@ -33,7 +33,7 @@ struct Vec3 {
z f32
}
fn vec3(x, y, z f32) Vec3 {
pub fn vec3(x, y, z f32) Vec3 {
res := Vec3 {
x: x,
y: y,