-
-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix #544] Correctly parse arguments with multiple separators
There was a problem when parsing things like SYM:VER=PATH, which split arguments by using different separators.
- Loading branch information
1 parent
260fe1d
commit 34fc20c
Showing
5 changed files
with
37 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,28 @@ | ||
(set-env! | ||
:source-paths #{"test"} | ||
:dependencies '[[org.clojure/tools.reader "1.0.0-alpha2"]]) | ||
:dependencies '[[org.clojure/tools.reader "1.0.0-alpha2"] | ||
[metosin/boot-alt-test "0.3.2" :scope "test"]]) | ||
|
||
(ns-unmap 'boot.user 'test) | ||
|
||
(require '[boot.test :refer [runtests test-report test-exit]] | ||
'boot.task.built-in-test | ||
'boot.test-test) | ||
'[metosin.boot-alt-test :refer [alt-test]]) | ||
|
||
(import boot.App) | ||
|
||
(ns-unmap 'boot.user 'test) | ||
|
||
(deftask test [] | ||
(boot.util/info "Testing against version %s\n" (App/config "BOOT_VERSION")) | ||
(comp (runtests) | ||
(deftask integration-test [] | ||
(set-env! :source-paths #{"integration-test"}) | ||
(comp (with-pass-thru [fs] | ||
(require 'boot.task.built-in-test | ||
'boot.test-test) | ||
(boot.util/info "Testing against version %s\n" (App/config "BOOT_VERSION"))) | ||
(runtests) | ||
(test-report) | ||
(test-exit))) | ||
|
||
(deftask unit-test [] | ||
(set-env! :source-paths #{"src" "unit-test"}) | ||
(alt-test)) | ||
|
||
(deftask test [] | ||
(comp (unit-test) | ||
(integration-test))) |
File renamed without changes.
File renamed without changes.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
(ns boot.cli-test | ||
(:require [boot.cli :as cli] | ||
[boot.from.clojure.tools.cli :as tools-cli] | ||
[clojure.test :as t])) | ||
|
||
(t/deftest cli-tests | ||
|
||
(t/testing "parse-cli" | ||
(let [argv ["-a" "test:test1=4"] | ||
cli-args (->> '[[a parent SYM:VER=PATH [sym str str]]] | ||
(mapv (partial apply #'cli/argspec->cli-argspec))) | ||
separate-cli-opts (#'cli/separate-cli-opts (:cli (#'cli/split-args argv)) cli-args)] | ||
(t/is (= "" (#'tools-cli/parse-opts separate-cli-opts cli-args)) "[fix #578] split arguments with two different separators.") | ||
) | ||
) | ||
|
||
) |