tests: make error handling the same as the main function (#15825)

This commit is contained in:
yuyi 2022-09-22 00:45:43 +08:00 committed by GitHub
parent 391ac12fe2
commit 41dbd12bc4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
69 changed files with 193 additions and 192 deletions

View file

@ -1,7 +1,7 @@
import net.http
import time
fn test_server_stop() ? {
fn test_server_stop() {
mut server := &http.Server{
accept_timeout: 1 * time.second
}
@ -15,7 +15,7 @@ fn test_server_stop() ? {
assert watch.elapsed() < 999 * time.millisecond
}
fn test_server_close() ? {
fn test_server_close() {
mut server := &http.Server{
accept_timeout: 1 * time.second
handler: MyHttpHandler{}
@ -60,7 +60,7 @@ fn (mut handler MyHttpHandler) handle(req http.Request) http.Response {
const cport = 8198
fn test_server_custom_handler() ? {
fn test_server_custom_handler() {
mut handler := MyHttpHandler{}
mut server := &http.Server{
accept_timeout: 1 * time.second