babashka/script/lib_tests/regal_test

23 lines
509 B
Text
Raw Normal View History

2020-02-19 22:58:49 +00:00
#!/usr/bin/env bash
set -eo pipefail
2020-04-11 18:47:24 +00:00
export BABASHKA_CLASSPATH="$(clojure -Sdeps '{:deps {regal {:git/url "https://github.com/lambdaisland/regal" :sha "b059fdb06d5586a9a04c27e7b011c467ad8546db"}}}' -Spath)"
2020-02-19 22:58:49 +00:00
if [ "$BABASHKA_TEST_ENV" = "native" ]; then
BB_CMD="./bb"
else
BB_CMD="lein bb"
fi
2020-04-11 18:47:24 +00:00
$BB_CMD "
(require '[lambdaisland.regal :as regal])
(def r [:cat
[:+ [:class [\a \z]]]
\"=\"
[:+ [:not \=]]])
(prn (regal/regex r))
(prn (re-matches (regal/regex r) \"foo=bar\"))
"