nim-ladybug/tests/tuples/t_throws_exception_invalid_index.nim

21 lines
460 B
Nim
Raw Permalink Normal View History

# vim: set et sta sw=4 ts=4 :
import
std/re
import lbug
let db = newLbugDatabase()
let conn = db.connect
var q = conn.query( "CREATE NODE TABLE Doop ( id SERIAL, thing STRING, PRIMARY KEY(id) )" )
q = conn.query( "CREATE (d:Doop {thing: 'okay!'})" )
q = conn.query( "MATCH (d:Doop) RETURN d.thing" )
let tup = q.getNext
try:
echo tup[22]
except LbugIndexError as err:
assert err.msg.contains( re"""Unable to fetch tuple value at idx 22.""" )