aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/test/lux/control/security/integrity.lux
diff options
context:
space:
mode:
Diffstat (limited to 'stdlib/source/test/lux/control/security/integrity.lux')
-rw-r--r--stdlib/source/test/lux/control/security/integrity.lux55
1 files changed, 0 insertions, 55 deletions
diff --git a/stdlib/source/test/lux/control/security/integrity.lux b/stdlib/source/test/lux/control/security/integrity.lux
deleted file mode 100644
index 77e0505d6..000000000
--- a/stdlib/source/test/lux/control/security/integrity.lux
+++ /dev/null
@@ -1,55 +0,0 @@
-(.module:
- [lux #*
- ["_" test (#+ Test)]
- [abstract
- [hash (#+ Hash)]
- [monad (#+ do)]
- {[0 #test]
- [/
- ["$." functor (#+ Injection Comparison)]
- ["$." apply]
- ["$." monad]]}]
- [data
- ["." error]
- ["." text ("#;." equivalence)
- format]]
- [math
- ["r" random]]]
- {1
- ["." / (#+ Dirty)]})
-
-(def: injection
- (Injection Dirty)
- /.taint)
-
-(def: comparison
- (Comparison Dirty)
- (function (_ == left right)
- (== (/.trust left)
- (/.trust right))))
-
-(def: #export test
- Test
- (<| (_.context (%name (name-of /.Dirty)))
- (do r.monad
- [raw (r.ascii 10)
- #let [dirty (/.taint raw)]]
- ($_ _.and
- ($functor.spec ..injection ..comparison /.functor)
- ($apply.spec ..injection ..comparison /.apply)
- ($monad.spec ..injection ..comparison /.monad)
-
- (_.test "Can clean a dirty value by trusting it."
- (text;= raw (/.trust dirty)))
- (_.test "Can validate a dirty value."
- (case (/.validate (function (_ value)
- (if (|> value text.size (n/> 0))
- (#error.Success value)
- (#error.Failure "Empty text is invalid.")))
- dirty)
- (#error.Success clean)
- (text;= raw clean)
-
- (#error.Failure error)
- false))
- ))))