From 6b12e2e3bcfa8074b1b2f6ab766f5140765824c9 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 10 Jul 2016 20:28:46 -0700 Subject: [PATCH] use ?delete-file instead of [ delete-file ] ignore-errors. --- basis/concurrency/distributed/distributed-tests.factor | 5 +++-- basis/db/pools/pools-tests.factor | 2 +- basis/db/sqlite/sqlite-tests.factor | 2 +- basis/furnace/auth/providers/db/db-tests.factor | 2 +- basis/furnace/sessions/sessions-tests.factor | 2 +- basis/http/http-tests.factor | 2 +- basis/io/launcher/unix/unix-tests.factor | 4 ++-- basis/tools/deploy/test/test.factor | 2 +- extra/gdbm/gdbm-tests.factor | 2 +- extra/site-watcher/site-watcher-tests.factor | 2 +- extra/webapps/mason/backend/backend-tests.factor | 2 +- unmaintained/semantic-db/semantic-db-tests.factor | 2 +- unmaintained/tangle/sandbox/sandbox.factor | 2 +- unmaintained/tangle/tangle-tests.factor | 2 +- 14 files changed, 17 insertions(+), 16 deletions(-) diff --git a/basis/concurrency/distributed/distributed-tests.factor b/basis/concurrency/distributed/distributed-tests.factor index 7bb1469fa3..83d596cca3 100644 --- a/basis/concurrency/distributed/distributed-tests.factor +++ b/basis/concurrency/distributed/distributed-tests.factor @@ -19,8 +19,9 @@ CONSTANT: test-ip "127.0.0.1" { [ os windows? ] [ insecure-addr ] } } cond ; - -{ } [ [ "distributed-concurrency-test" temp-file delete-file ] ignore-errors ] unit-test +os unix? [ + "distributed-concurrency-test" temp-file ?delete-file +] when test-node-server [ [ ] [ diff --git a/basis/db/pools/pools-tests.factor b/basis/db/pools/pools-tests.factor index 8fba5cf264..e0b0adfd13 100644 --- a/basis/db/pools/pools-tests.factor +++ b/basis/db/pools/pools-tests.factor @@ -9,7 +9,7 @@ io.directories namespaces accessors kernel math destructors ; ! Test behavior after image save/load USE: db.sqlite -[ "pool-test.db" temp-file delete-file ] ignore-errors +"pool-test.db" temp-file ?delete-file { } [ "pool-test.db" temp-file "pool" set ] unit-test diff --git a/basis/db/sqlite/sqlite-tests.factor b/basis/db/sqlite/sqlite-tests.factor index 660f33171c..b5866a71f3 100644 --- a/basis/db/sqlite/sqlite-tests.factor +++ b/basis/db/sqlite/sqlite-tests.factor @@ -7,7 +7,7 @@ IN: db.sqlite.tests : db-path ( -- path ) "test-" cell number>string ".db" 3append temp-file ; : test.db ( -- sqlite-db ) db-path ; -{ } [ [ db-path delete-file ] ignore-errors ] unit-test +db-path ?delete-file { } [ test.db [ diff --git a/basis/furnace/auth/providers/db/db-tests.factor b/basis/furnace/auth/providers/db/db-tests.factor index 41c8cfda39..d76b0a2527 100644 --- a/basis/furnace/auth/providers/db/db-tests.factor +++ b/basis/furnace/auth/providers/db/db-tests.factor @@ -13,7 +13,7 @@ IN: furnace.auth.providers.db.tests : auth-test-db-name ( -- string ) cpu name>> "auth-test." ".db" surround ; -[ auth-test-db-name temp-file delete-file ] ignore-errors +auth-test-db-name temp-file ?delete-file auth-test-db-name temp-file [ diff --git a/basis/furnace/sessions/sessions-tests.factor b/basis/furnace/sessions/sessions-tests.factor index 479a5caa6e..030ebd9254 100644 --- a/basis/furnace/sessions/sessions-tests.factor +++ b/basis/furnace/sessions/sessions-tests.factor @@ -49,7 +49,7 @@ M: foo call-responder* [ [ ] exit-with ] >>display ; -[ "auth-test.db" temp-file delete-file ] ignore-errors +"auth-test.db" temp-file ?delete-file "auth-test.db" temp-file [ diff --git a/basis/http/http-tests.factor b/basis/http/http-tests.factor index 4ad53ecb64..5067e7ea05 100644 --- a/basis/http/http-tests.factor +++ b/basis/http/http-tests.factor @@ -229,7 +229,7 @@ http.server.dispatchers db.tuples ; "Goodbye" assert= ; { } [ - [ test-db-file delete-file ] ignore-errors + test-db-file ?delete-file test-db [ init-furnace-tables diff --git a/basis/io/launcher/unix/unix-tests.factor b/basis/io/launcher/unix/unix-tests.factor index a07b60b918..a1913058c0 100644 --- a/basis/io/launcher/unix/unix-tests.factor +++ b/basis/io/launcher/unix/unix-tests.factor @@ -13,7 +13,7 @@ IN: io.launcher.unix.tests { t } [ "launcher-test-1" exists? ] unit-test { } [ - [ "launcher-test-1" delete-file ] ignore-errors + "launcher-test-1" ?delete-file ] unit-test { } [ @@ -29,7 +29,7 @@ IN: io.launcher.unix.tests ] unit-test { } [ - [ "launcher-test-1" delete-file ] ignore-errors + "launcher-test-1" ?delete-file ] unit-test { } [ diff --git a/basis/tools/deploy/test/test.factor b/basis/tools/deploy/test/test.factor index 3925e06e5c..d90ee2caf9 100644 --- a/basis/tools/deploy/test/test.factor +++ b/basis/tools/deploy/test/test.factor @@ -11,7 +11,7 @@ IN: tools.deploy.test test-image temp-file ; : shake-and-bake ( vocab -- ) - [ test-image-path delete-file ] ignore-errors + test-image-path ?delete-file [ [ vm-path test-image temp-file ] dip dup deploy-config make-deploy-image drop diff --git a/extra/gdbm/gdbm-tests.factor b/extra/gdbm/gdbm-tests.factor index c9e32f3f88..d50e972914 100644 --- a/extra/gdbm/gdbm-tests.factor +++ b/extra/gdbm/gdbm-tests.factor @@ -6,7 +6,7 @@ IN: gdbm.tests : db-path ( -- filename ) cpu name>> "-test.db" append temp-file ; -: CLEANUP ( -- ) [ db-path delete-file ] ignore-errors ; +: CLEANUP ( -- ) db-path ?delete-file ; : test.db ( -- gdbm ) db-path >>name ; diff --git a/extra/site-watcher/site-watcher-tests.factor b/extra/site-watcher/site-watcher-tests.factor index 77ae155f4a..02f6bdbc8d 100644 --- a/extra/site-watcher/site-watcher-tests.factor +++ b/extra/site-watcher/site-watcher-tests.factor @@ -4,7 +4,7 @@ USING: continuations db db.tuples io.directories io.files.temp kernel locals sequences site-watcher.db tools.test webapps.utils ; IN: site-watcher.tests -[ "site-watcher.db" temp-file delete-file ] ignore-errors +"site-watcher.db" temp-file ?delete-file :: fake-sites ( -- seq ) "site-watcher.db" [ diff --git a/extra/webapps/mason/backend/backend-tests.factor b/extra/webapps/mason/backend/backend-tests.factor index 2dd10b82d0..9387689d7b 100644 --- a/extra/webapps/mason/backend/backend-tests.factor +++ b/extra/webapps/mason/backend/backend-tests.factor @@ -2,7 +2,7 @@ USING: accessors calendar continuations db io.directories io.files.temp kernel tools.test webapps.mason.backend webapps.utils ; IN: webapps.mason.backend.tests -[ "mason-test.db" temp-file delete-file ] ignore-errors +"mason-test.db" temp-file ?delete-file { 0 1 2 } [ ! Do it in a with-transaction to simulate semantics of diff --git a/unmaintained/semantic-db/semantic-db-tests.factor b/unmaintained/semantic-db/semantic-db-tests.factor index 484af741aa..6747141e7f 100644 --- a/unmaintained/semantic-db/semantic-db-tests.factor +++ b/unmaintained/semantic-db/semantic-db-tests.factor @@ -7,7 +7,7 @@ SYMBOL: context : db-path "semantic-db-test.db" temp-file ; : test-db db-path sqlite-db ; -: delete-db [ db-path delete-file ] ignore-errors ; +: delete-db db-path ?delete-file ; delete-db diff --git a/unmaintained/tangle/sandbox/sandbox.factor b/unmaintained/tangle/sandbox/sandbox.factor index b44acb7617..6939131d48 100644 --- a/unmaintained/tangle/sandbox/sandbox.factor +++ b/unmaintained/tangle/sandbox/sandbox.factor @@ -3,7 +3,7 @@ IN: tangle.sandbox : db-path "tangle-sandbox.db" temp-file ; : sandbox-db db-path sqlite-db ; -: delete-db [ db-path delete-file ] ignore-errors ; +: delete-db db-path ?delete-file ; : make-sandbox ( tangle -- ) [ diff --git a/unmaintained/tangle/tangle-tests.factor b/unmaintained/tangle/tangle-tests.factor index c7e9f2d79a..a054fca898 100644 --- a/unmaintained/tangle/tangle-tests.factor +++ b/unmaintained/tangle/tangle-tests.factor @@ -3,7 +3,7 @@ IN: tangle.tests : db-path "tangle-test.db" temp-file ; : test-db db-path sqlite-db ; -: delete-db [ db-path delete-file ] ignore-errors ; +: delete-db db-path ?delete-file ; : test-tangle ( -- ) ensure-root "foo" create-file "bar" create-file "pluck_eggs" create-file