You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 lines
841 B
Clojure

(ns org.domaindrivenarchitecture.fed-poc.owl-test
(:require
[clojure.test :refer [deftest is are testing run-tests]]
[clojure.spec.test.alpha :as st]
[clojure.spec.alpha :as s]
[org.domaindrivenarchitecture.fed-poc.owl :as sut]))
(deftest functional-predicate
(is (sut/functional? "str"))
(is (sut/functional? 2))
(is (sut/functional? ["str"]))
(is (not (sut/functional? [])))
(is (not (sut/functional? nil)))
(is (not (sut/functional? [1 2]))))
(deftest owl-class-predicate
(is (sut/owl-class? "http://some.uri"))
(is (sut/owl-class? {:as "class-definition"}))
(is (sut/owl-class? []))
(is (not (sut/owl-class? "http://str:not-a-port")))
(is (not (sut/owl-class? nil))))
(deftest class-test
(is (s/valid? ::sut/Class "https://social.bla/alyssa/status/RANDOMHASH"))
(is (s/valid? ::sut/Class {})))