fix tests
parent
2ca6859982
commit
d998313bb1
|
@ -1 +1,2 @@
|
|||
*.dSYM
|
||||
*_test
|
||||
|
|
|
@ -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 (
|
||||
|
|
|
@ -143,7 +143,7 @@ fn (s string) int() int {
|
|||
}
|
||||
|
||||
fn (s string) f32() f32 {
|
||||
return C.atof(s.str)
|
||||
return C.atof(s.str)
|
||||
}
|
||||
|
||||
// ==
|
||||
|
@ -332,7 +332,7 @@ pub fn (s string) right(n int) string {
|
|||
// puts(substr.str) will print 'rivet'
|
||||
// Avoid using C functions with these substrs!
|
||||
pub fn (s string) substr(start, end int) string {
|
||||
/*
|
||||
/*
|
||||
if start > end || start >= s.len || end > s.len || start < 0 || end < 0 {
|
||||
panic('substr($start, $end) out of bounds (len=$s.len)')
|
||||
return ''
|
||||
|
|
|
@ -289,4 +289,5 @@ fn test_all_after() {
|
|||
s := 'fn hello'
|
||||
q := s.all_after('fn ')
|
||||
assert q == 'hello'
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue