if we're on win64, don't run postgresql tests
parent
799f761bef
commit
87bdc0acd3
|
@ -1,6 +1,6 @@
|
||||||
USING: kernel db.postgresql alien continuations io classes
|
USING: kernel db.postgresql alien continuations io classes
|
||||||
prettyprint sequences namespaces tools.test db
|
prettyprint sequences namespaces tools.test db
|
||||||
db.tuples db.types unicode.case accessors ;
|
db.tuples db.types unicode.case accessors system ;
|
||||||
IN: db.postgresql.tests
|
IN: db.postgresql.tests
|
||||||
|
|
||||||
: test-db ( -- postgresql-db )
|
: test-db ( -- postgresql-db )
|
||||||
|
@ -10,86 +10,88 @@ IN: db.postgresql.tests
|
||||||
"thepasswordistrust" >>password
|
"thepasswordistrust" >>password
|
||||||
"factor-test" >>database ;
|
"factor-test" >>database ;
|
||||||
|
|
||||||
[ ] [ test-db [ ] with-db ] unit-test
|
os windows? cpu x86.64? and [
|
||||||
|
[ ] [ test-db [ ] with-db ] unit-test
|
||||||
|
|
||||||
[ ] [
|
[ ] [
|
||||||
test-db [
|
test-db [
|
||||||
[ "drop table person;" sql-command ] ignore-errors
|
[ "drop table person;" sql-command ] ignore-errors
|
||||||
"create table person (name varchar(30), country varchar(30));"
|
"create table person (name varchar(30), country varchar(30));"
|
||||||
|
sql-command
|
||||||
|
|
||||||
|
"insert into person values('John', 'America');" sql-command
|
||||||
|
"insert into person values('Jane', 'New Zealand');" sql-command
|
||||||
|
] with-db
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
{ "John" "America" }
|
||||||
|
{ "Jane" "New Zealand" }
|
||||||
|
}
|
||||||
|
] [
|
||||||
|
test-db [
|
||||||
|
"select * from person" sql-query
|
||||||
|
] with-db
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
{
|
||||||
|
{ "John" "America" }
|
||||||
|
{ "Jane" "New Zealand" }
|
||||||
|
}
|
||||||
|
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
|
||||||
|
|
||||||
|
[
|
||||||
|
] [
|
||||||
|
test-db [
|
||||||
|
"insert into person(name, country) values('Jimmy', 'Canada')"
|
||||||
sql-command
|
sql-command
|
||||||
|
] with-db
|
||||||
|
] unit-test
|
||||||
|
|
||||||
"insert into person values('John', 'America');" sql-command
|
[
|
||||||
"insert into person values('Jane', 'New Zealand');" sql-command
|
{
|
||||||
] with-db
|
{ "John" "America" }
|
||||||
] unit-test
|
{ "Jane" "New Zealand" }
|
||||||
|
{ "Jimmy" "Canada" }
|
||||||
|
}
|
||||||
|
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
|
||||||
|
|
||||||
[
|
[
|
||||||
{
|
test-db [
|
||||||
{ "John" "America" }
|
[
|
||||||
{ "Jane" "New Zealand" }
|
"insert into person(name, country) values('Jose', 'Mexico')" sql-command
|
||||||
}
|
"insert into person(name, country) values('Jose', 'Mexico')" sql-command
|
||||||
] [
|
"oops" throw
|
||||||
test-db [
|
] with-transaction
|
||||||
"select * from person" sql-query
|
] with-db
|
||||||
] with-db
|
] must-fail
|
||||||
] unit-test
|
|
||||||
|
|
||||||
[
|
[ 3 ] [
|
||||||
{
|
test-db [
|
||||||
{ "John" "America" }
|
"select * from person" sql-query length
|
||||||
{ "Jane" "New Zealand" }
|
] with-db
|
||||||
}
|
] unit-test
|
||||||
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
|
|
||||||
|
|
||||||
[
|
[
|
||||||
] [
|
] [
|
||||||
test-db [
|
test-db [
|
||||||
"insert into person(name, country) values('Jimmy', 'Canada')"
|
[
|
||||||
sql-command
|
"insert into person(name, country) values('Jose', 'Mexico')"
|
||||||
] with-db
|
sql-command
|
||||||
] unit-test
|
"insert into person(name, country) values('Jose', 'Mexico')"
|
||||||
|
sql-command
|
||||||
|
] with-transaction
|
||||||
|
] with-db
|
||||||
|
] unit-test
|
||||||
|
|
||||||
[
|
[ 5 ] [
|
||||||
{
|
test-db [
|
||||||
{ "John" "America" }
|
"select * from person" sql-query length
|
||||||
{ "Jane" "New Zealand" }
|
] with-db
|
||||||
{ "Jimmy" "Canada" }
|
] unit-test
|
||||||
}
|
] unless
|
||||||
] [ test-db [ "select * from person" sql-query ] with-db ] unit-test
|
|
||||||
|
|
||||||
[
|
|
||||||
test-db [
|
|
||||||
[
|
|
||||||
"insert into person(name, country) values('Jose', 'Mexico')" sql-command
|
|
||||||
"insert into person(name, country) values('Jose', 'Mexico')" sql-command
|
|
||||||
"oops" throw
|
|
||||||
] with-transaction
|
|
||||||
] with-db
|
|
||||||
] must-fail
|
|
||||||
|
|
||||||
[ 3 ] [
|
|
||||||
test-db [
|
|
||||||
"select * from person" sql-query length
|
|
||||||
] with-db
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
[
|
|
||||||
] [
|
|
||||||
test-db [
|
|
||||||
[
|
|
||||||
"insert into person(name, country) values('Jose', 'Mexico')"
|
|
||||||
sql-command
|
|
||||||
"insert into person(name, country) values('Jose', 'Mexico')"
|
|
||||||
sql-command
|
|
||||||
] with-transaction
|
|
||||||
] with-db
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
[ 5 ] [
|
|
||||||
test-db [
|
|
||||||
"select * from person" sql-query length
|
|
||||||
] with-db
|
|
||||||
] unit-test
|
|
||||||
|
|
||||||
|
|
||||||
: with-dummy-db ( quot -- )
|
: with-dummy-db ( quot -- )
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
USING: io.files kernel tools.test db db.tuples classes
|
USING: io.files kernel tools.test db db.tuples classes
|
||||||
db.types continuations namespaces math math.ranges
|
db.types continuations namespaces math math.ranges
|
||||||
prettyprint calendar sequences db.sqlite math.intervals
|
prettyprint calendar sequences db.sqlite math.intervals
|
||||||
db.postgresql accessors random math.bitwise
|
db.postgresql accessors random math.bitwise system
|
||||||
math.ranges strings urls fry db.tuples.private ;
|
math.ranges strings urls fry db.tuples.private ;
|
||||||
IN: db.tuples.tests
|
IN: db.tuples.tests
|
||||||
|
|
||||||
|
@ -26,7 +26,9 @@ IN: db.tuples.tests
|
||||||
|
|
||||||
: test-postgresql ( quot -- )
|
: test-postgresql ( quot -- )
|
||||||
'[
|
'[
|
||||||
[ ] [ postgresql-db _ with-db ] unit-test
|
os windows? cpu x86.64? and [
|
||||||
|
[ ] [ postgresql-db _ with-db ] unit-test
|
||||||
|
] unless
|
||||||
] call ; inline
|
] call ; inline
|
||||||
|
|
||||||
! These words leak resources, but are useful for interactivel testing
|
! These words leak resources, but are useful for interactivel testing
|
||||||
|
|
Loading…
Reference in New Issue