From ed64521572d92e96e3e988a064b949f8400cd305 Mon Sep 17 00:00:00 2001 From: Alan Thompson Date: Fri, 3 Mar 2023 11:42:23 -0800 Subject: [PATCH] misc --- build.clj | 9 +++---- src/cljc/tupelo/core.cljc | 3 ++- test-refresh.edn | 47 ++++++++++++++++++++++++++++++++++ test/cljc/tst/tupelo/core.cljc | 4 ++- 4 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 test-refresh.edn diff --git a/build.clj b/build.clj index e8acc729..470ce25c 100644 --- a/build.clj +++ b/build.clj @@ -5,7 +5,7 @@ )) (def lib-name 'tupelo/tupelo) ; must be a qualified symbol -(def version "23.03.03b-SHAPSHOT") +(def version "23.03.03c-SHAPSHOT") (def tag (str "v" version)) (def build-folder "target") @@ -30,13 +30,10 @@ :version version :basis basis :src-dirs ["src"] - :scm { - - :url "https://github.com/cloojure/tupelo" + :scm {:url "https://github.com/cloojure/tupelo" :connection "scm:git:git://github.com/cloojure/tupelo.git" :developerConnection "scm:git:ssh://git@github.com/cloojure/tupelo.git" - } - }) + :tag tag}}) (b/jar {:class-dir jar-content ; create jar :jar-file jar-file-name}) diff --git a/src/cljc/tupelo/core.cljc b/src/cljc/tupelo/core.cljc index 57b2cec9..5a3cb63e 100644 --- a/src/cljc/tupelo/core.cljc +++ b/src/cljc/tupelo/core.cljc @@ -2895,7 +2895,8 @@ idxs []] (if-not (<= i N-1) idxs - (let [[data1 data2] (split-at i data) + (let [data1 (subvec data 0 i) + data2 (subvec data i N) split? (pred data1 data2) result-next (if split? (append idxs i) diff --git a/test-refresh.edn b/test-refresh.edn new file mode 100644 index 00000000..696520e3 --- /dev/null +++ b/test-refresh.edn @@ -0,0 +1,47 @@ +{; Specifies a command to run on test failure/success. Short message is passed as the + ; last argument to the command. Defaults to no command. + ;; :notify-command ["terminal-notifier" "-title" "Tests" "-message"] + + ; Set to true to send notifications to growl. Defaults to false. + ;; :growl false + + ; only growl and use the notify command if there are failures. Defaults to true. + ;; :notify-on-success false + + ; Stop clojure.test from printing "Testing namespace.being.tested". + ; Very useful on codebases with many test namespaces. Defaults to false. + :quiet true + + ; If this is specified then only tests in namespaces that were just reloaded by tools.namespace + ; (namespaces where a change was detected in it or a dependent namespace) are run. This can also be + ; passed as a command line option: lein test-refresh :changes-only. + :changes-only true + + ; If specified, binds value to clojure.test/*stack-trace-depth* + :stack-trace-depth nil + + ; specifiy a custom clojure.test report method + ; Specify the namespace and multimethod that will handle reporting + ; from test-refresh. The namespace must be available to the project dependencies. + ; Defaults to no custom reporter + ;; :report myreport.namespace/my-report + + ; If set to a truthy value, then lein test-refresh will only run your tests once. Also supported as a + ; command line option. Reasoning for feature can be found in PR: + ; https://github.com/jakemcc/lein-test-refresh/pull/48 + :run-once true + + ; If given, watch for changes only in the given folders. By default, watches for changes on entire classpath. + :watch-dirs ["src" "test"] + + ; If given, only refresh code in the given directories. By default every directory on the + ; classpath is refreshed. Value is passed through to clojure.tools.namespace.repl/set-refresh-dirs + ; https://github.com/clojure/tools.namespace/blob/f3f5b29689c2bda53b4977cf97f5588f82c9bd00/src/main/clojure/clojure/tools/namespace/repl.clj#L164 + :refresh-dirs ["src" "test"] + + + ; Use this flag to specify your own flag to add to cause test-refresh to focus. Intended to be used + ; to let you specify a shorter flag than the default :test-refresh/focus. + :focus-flag :test-refresh/focus + + } diff --git a/test/cljc/tst/tupelo/core.cljc b/test/cljc/tst/tupelo/core.cljc index 9f8c9ae4..b7725789 100644 --- a/test/cljc/tst/tupelo/core.cljc +++ b/test/cljc/tst/tupelo/core.cljc @@ -2019,7 +2019,9 @@ [[1 2] [3] [6 7 8] [9] [12 13] [15 16 17] [18] [18] [18] [3 4 5]])) (throws? (t/partition-using even? 5))) -(dotest ; #todo fix so use `verify` for both clj and cljs + +; #todo fix so use `verify` for both clj and cljs +(dotest-focus ; We use `split-at` to partition the coll. Given a coll like [0 1 2], it makes ; no sense to give degenerate splits like {:data1 [] :data2 [0 1 2]}