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

make_tests.bat: exit with error on failed test

This commit is contained in:
vitalyster 2019-08-01 14:23:36 +03:00 committed by Alexander Medvednikov
parent eb313ebb5b
commit 0197f20d47
2 changed files with 13 additions and 2 deletions

View File

@ -1,5 +1,16 @@
@echo off
curl -O https://raw.githubusercontent.com/vlang/vc/master/v.c curl -O https://raw.githubusercontent.com/vlang/vc/master/v.c
gcc -std=gnu11 -DUNICODE -D_UNICODE -w -o vc.exe v.c gcc -std=gnu11 -DUNICODE -D_UNICODE -w -o vc.exe v.c
del v.c del v.c
vc.exe -o v.exe compiler vc.exe -o v.exe compiler
for /r . %%x in (*_test.v) do @v -o test.exe -debug %%x setlocal EnableDelayedExpansion
for /r . %%x in (*_test.v) do (
v -o test.exe -debug %%x
if !ERRORLEVEL! NEQ 0 goto :fail
)
goto :done
:fail
exit /b 1
:done

View File

@ -162,7 +162,7 @@ pub fn escape_url(s string) string {
pub fn unescape_url(s string) string { pub fn unescape_url(s string) string {
mut buf := &u16(malloc(INTERNET_MAX_URL_LENGTH * 2)) mut buf := &u16(malloc(INTERNET_MAX_URL_LENGTH * 2))
mut nr_chars := INTERNET_MAX_URL_LENGTH mut nr_chars := INTERNET_MAX_URL_LENGTH
res := C.UrlUnescape(s.to_wide(), &buf, &nr_chars, URL_ESCAPE_AS_UTF8 | URL_ESCAPE_ASCII_URI_COMPONENT) res := C.UrlUnescape(s.to_wide(), buf, &nr_chars, URL_ESCAPE_AS_UTF8 | URL_ESCAPE_ASCII_URI_COMPONENT)
return string_from_wide2(buf, nr_chars) return string_from_wide2(buf, nr_chars)
} }