add tests

This commit is contained in:
Mirco 2023-07-25 09:12:26 +02:00
parent d50a2cf5dc
commit d4422ad19e
2 changed files with 16 additions and 1 deletions

View file

@ -48,6 +48,7 @@
;TODO: definition in progress ;TODO: definition in progress
(s/def ::Link (s/keys :opt-un [::id])) (s/def ::Link (s/keys :opt-un [::id]))
;TODO: There is no as:Class! Why do we need this?
(s/def (s/def
::Class ::Class
(s/merge ::owl/Class (s/merge ::owl/Class

View file

@ -14,4 +14,18 @@
(is (not (s/valid? ::sut/id nil))) (is (not (s/valid? ::sut/id nil)))
(is (not (s/valid? ::sut/id 2))) (is (not (s/valid? ::sut/id 2)))
(is (not (s/valid? ::sut/id "no-uri"))) (is (not (s/valid? ::sut/id "no-uri")))
) (is (not (s/valid? ::sut/id ["https://social.bla/alyssa/status/RANDOMHASH", "https://social.bla/alyssa/status/RANDOMHASH2"])))
)
(deftest result-test
(is (s/valid? ::sut/result "https://social.bla/alyssa/result/RANDOMHASH"))
(is (s/valid? ::sut/result {:type "http://www.types.example/flightstatus", :name "On Time"}))
(is (s/valid? ::sut/result {:type "Link" :href "http://www.target.de"}))
(is (not (s/valid? ::sut/result nil)))
(is (not (s/valid? ::sut/result 47)))
)
;(deftest attachment-test
; (is (s/valid? ::sut/attachment))
; )