26 lines
		
	
	
		
			626 B
		
	
	
	
		
			Factor
		
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			626 B
		
	
	
	
		
			Factor
		
	
	
| ! Copyright (C) 2009 Doug Coleman.
 | |
| ! See http://factorcode.org/license.txt for BSD license.
 | |
| USING: accessors combinators.short-circuit db db.errors
 | |
| db.sqlite kernel locals tools.test ;
 | |
| 
 | |
| [| path |
 | |
| 
 | |
|     path <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
 | |
| ] with-test-file
 |