vweb: change port for cookie test, fix error reporting

pull/10450/head
bettafish 2021-06-16 21:19:37 +02:00
parent 4af25b1a04
commit 3e26bef11f
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ import vweb
import net.http import net.http
const ( const (
port = 8000 port = 12380
) )
struct App { struct App {
@ -26,7 +26,7 @@ fn (mut app App) index() vweb.Result {
fn test_cookie() { fn test_cookie() {
go vweb.run(&App{}, port) go vweb.run(&App{}, port)
resp := http.get('http://127.0.0.1:$port/') or { panic('server not running') } resp := http.get('http://127.0.0.1:$port/') or { panic(err) }
darkmode := resp.cookies['darkmode'] or { panic('cookie not set') } darkmode := resp.cookies['darkmode'] or { panic('cookie not set') }
value := darkmode[0].ascii_str().int() value := darkmode[0].ascii_str().int()
mut path := '' mut path := ''