babashka/test-resources/lib_tests/version_clj/via_use_test.clj
Lee Read 5d9027fe0a
Added lib tests for version-clj (#569)
The version-clj project uses `.cljx` so I hand-transcribed them to `.cljc`.

Tests are from from version-clj v1.0.2:
https://github.com/xsc/version-clj/tree/clojars-0.1.2

Added `version-clj.via-use-test` to verify loading version-clj via `use`.

Verification via: `./script/run_lib_tests`, I observed version-clj tests:
1. failing for `bb` native v0.2.0
2. passing for `./bb` native built from master
3. passing for `lein bb` from master

This should be the final change that closes #565.
2020-09-09 23:03:15 +02:00

13 lines
594 B
Clojure

(ns version-clj.via-use-test
"Babashka was failing when loading version-clj via `use` and `require`->`:refer`.
The unit tests transcribed from version-clj address the require->refer case.
This set of tests spot-check that loading via use works for version-clj."
(:require [clojure.test :refer [deftest is]]))
(use 'version-clj.core)
(deftest sanity-test
(is (= [[1 0 0] ["snapshot"]] (version->seq "1.0.0-SNAPSHOT")))
(is (= 0 (version-compare "1.0" "1.0.0")))
(is (= -1 (version-compare "1.0-alpha5" "1.0-alpha14")))
(is (= 1 (version-compare "1.0-alpha14" "1.0-alpha5"))) )