mirror of
https://github.com/vlang/v.git
synced 2025-09-17 00:12:26 +03:00
Compare commits
No commits in common. "6e0fd17a721362b53218cddd8d2ef230e76aba44" and "3080b4168771f934a7a17f0f5da356f8ad50da5f" have entirely different histories.
6e0fd17a72
...
3080b41687
4 changed files with 2 additions and 56 deletions
|
@ -1,4 +1,4 @@
|
||||||
// vtest build: linux
|
// vtest build: !windows
|
||||||
// vtest retry: 2
|
// vtest retry: 2
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
// vtest retry: 2
|
|
||||||
import os
|
import os
|
||||||
import benchmark
|
import benchmark
|
||||||
import term
|
import term
|
||||||
|
|
|
@ -4479,7 +4479,7 @@ fn (mut g Gen) selector_expr(node ast.SelectorExpr) {
|
||||||
}
|
}
|
||||||
// struct embedding
|
// struct embedding
|
||||||
mut has_embed := false
|
mut has_embed := false
|
||||||
if sym.info in [ast.Alias, ast.Struct, ast.Aggregate] {
|
if sym.info in [ast.Struct, ast.Aggregate] {
|
||||||
if node.generic_from_embed_types.len > 0 && sym.info is ast.Struct {
|
if node.generic_from_embed_types.len > 0 && sym.info is ast.Struct {
|
||||||
if sym.info.embeds.len > 0 {
|
if sym.info.embeds.len > 0 {
|
||||||
mut is_find := false
|
mut is_find := false
|
||||||
|
|
|
@ -1,53 +0,0 @@
|
||||||
import os
|
|
||||||
import veb
|
|
||||||
import time
|
|
||||||
import net.http
|
|
||||||
|
|
||||||
const app_port = 29123
|
|
||||||
const exit_after = 10 * time.second
|
|
||||||
|
|
||||||
pub struct Context {
|
|
||||||
veb.Context
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct App {
|
|
||||||
veb.Middleware[Context]
|
|
||||||
veb.Controller
|
|
||||||
veb.StaticHandler
|
|
||||||
started chan bool
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn (mut app App) before_accept_loop() {
|
|
||||||
app.started <- true
|
|
||||||
}
|
|
||||||
|
|
||||||
type AliasApp = App
|
|
||||||
type AliasContext = Context
|
|
||||||
|
|
||||||
fn testsuite_begin() {
|
|
||||||
os.chdir(os.dir(@FILE))!
|
|
||||||
spawn fn () {
|
|
||||||
time.sleep(exit_after)
|
|
||||||
assert true == false, 'timeout reached!'
|
|
||||||
exit(1)
|
|
||||||
}()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn test_aliased_app_compiles_and_starts() {
|
|
||||||
mut app := &AliasApp{}
|
|
||||||
spawn veb.run_at[AliasApp, AliasContext](mut app,
|
|
||||||
port: app_port
|
|
||||||
timeout_in_seconds: 2
|
|
||||||
family: .ip
|
|
||||||
)
|
|
||||||
eprintln('waiting for app to start ...')
|
|
||||||
_ := <-app.started
|
|
||||||
eprintln('>>> app was started')
|
|
||||||
}
|
|
||||||
|
|
||||||
fn test_static_root() {
|
|
||||||
x := http.get('http://127.0.0.1:${app_port}/')!
|
|
||||||
eprintln('>>>> http request was sent and received')
|
|
||||||
assert x.status() == .not_found
|
|
||||||
assert x.body == '404 Not Found'
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue