factor/basis/db/sqlite/errors/errors-tests.factor

29 lines
775 B
Factor
Raw Normal View History

! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors
db.sqlite db.sqlite.errors io.files.temp io.files.unique kernel
namespaces tools.test ;
[
"sqlite" "error-test" [
<sqlite-db> [
[
"insert into foo (id) values('1');" sql-command
] [
{ [ sql-table-missing? ] [ table>> "foo" = ] } 1&&
] must-fail-with
"create table foo(id);" sql-command
[
"create table foo(id);" sql-command
] [
{ [ sql-table-exists? ] [ table>> "foo" = ] } 1&&
] must-fail-with
] with-db
] cleanup-unique-file
] with-temp-directory