;;;; uuid-ossp-test.scm (use testbase testbase-output-human) (use uuid-ossp) (define-test test-uuid-ossp "OSSP UUID" (test/case "Nil" (expect-true (uuid? (make-uuid))) (expect-true (uuid-nil? (make-uuid))) (expect-true (uuid-nil? (uuid-clone (make-uuid)))) (expect-true (uuid-nil? (uuid-load "nil"))) ) (test/case "Comparison" (expect-true (uuid= (make-uuid) (make-uuid))) (expect-true (uuid<= (make-uuid) (make-uuid))) (expect-true (uuid>= (make-uuid) (make-uuid))) ) (test/case "Make" (expect-not-false "V1" (make-uuid 'V1)) (expect-not-false "V1-MC" (make-uuid 'V1-MC)) (expect-not-false "V3" (make-uuid 'V3 "ns:URL" "foobarbaz")) (expect-not-false "V4" (make-uuid 'V4)) (expect-not-false "V5" (make-uuid 'V5 "ns:X500" "foobarbaz")) ) (test/case "Export" ( [tuuid (make-uuid 'V3 "ns:URL" "foobarbaz")] ) (expect-not-false (uuid-export tuuid)) (expect-not-false (uuid-export-binary tuuid)) (expect-not-false (uuid-export-text tuuid)) ) (test/case "Import" ( [tuuid (make-uuid 'V3 "ns:URL" "foobarbaz")] ) (expect-true (uuid= tuuid (uuid-import (uuid-export tuuid)))) (expect-true (uuid= tuuid (uuid-import-binary (uuid-export-binary tuuid)))) ) (test/case "Other" (expect-true (number? (uuid-version))) ) (test/case "Errors" (expect-failure (make-uuid 'V3 "ns:URL" "foobarbaz" 1 2)) (expect-failure (make-uuid 'R27)) (expect-failure (uuid-load "foobar")) ) (test/case "Finalizer" (expect-success (gc)) ) ) (run-test "Library UUID Tests")