Skip to content

Commit

Permalink
vweb: fix routes without results in vweb_app_test.v (#20548)
Browse files Browse the repository at this point in the history
  • Loading branch information
enghitalo committed Jan 15, 2024
1 parent 508117d commit 3b19864
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions vlib/vweb/vweb_app_test.v
Expand Up @@ -18,13 +18,13 @@ struct Article {
}

fn test_a_vweb_application_compiles() {
spawn fn () {
time.sleep(2 * time.second)
exit(0)
}()
vweb.run(&App{}, 18081)
}

pub fn (mut app App) before_accept_loop() {
exit(0)
}

pub fn (mut app App) before_request() {
app.user_id = app.get_cookie('id') or { '0' }
}
Expand All @@ -49,18 +49,18 @@ pub fn (mut app App) new_article() vweb.Result {
return app.redirect('/')
}

fn (mut app App) time() {
app.text(time.now().format())
fn (mut app App) time() vweb.Result {
return app.text(time.now().format())
}

fn (mut app App) time_json() {
app.json({
fn (mut app App) time_json() vweb.Result {
return app.json({
'time': time.now().format()
})
}

fn (mut app App) time_json_pretty() {
app.json_pretty({
fn (mut app App) time_json_pretty() vweb.Result {
return app.json_pretty({
'time': time.now().format()
})
}
Expand Down

0 comments on commit 3b19864

Please sign in to comment.