v2 / vlib / db / sqlite / sqlite_orm_option_field_test.v
26 lines · 23 sloc · 421 bytes · e8ad4adb65135a1aa61320619ad599fddf3c0d45
Raw
1// vtest build: present_sqlite3? && !windows && !sanitize-memory-clang && !docker-ubuntu-musl
2import db.sqlite
3
4@[table: 'foos']
5struct Foo {
6 value int
7}
8
9struct State {
10 val ?int
11}
12
13fn test_main() {
14 val := ?int(none)
15 state := State{val}
16 db := sqlite.connect(':memory:')!
17 if state.val != none {
18 v := sql db {
19 select from Foo where value < state.val
20 }!
21 println(v)
22 assert false
23 } else {
24 assert true
25 }
26}
27