module name substitution test fails if hypen in directory path

Description

Repro: mkdir /tmp/foo-bar, cd /tmp/foo-bar, clone ClojureScript there and go into clojurescript and then

1 lein test :only cljs.module-processing-tests/test-module-name-substitution

This results in what appears to be a munging-related failure:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 FAIL in (test-module-name-substitution) (module_processing_tests.clj:123) expected: (= (str "goog.provide('my_calculator.core');" crlf "goog.require('cljs.core');" crlf "goog.require('" (absolute-module-path "src/test/cljs/calculator.js" true) "');" crlf) (compile (quote (ns my-calculator.core (:require [calculator :as calc :refer [subtract add] :rename {subtract sub}]))))) actual: (not (= "goog.provide('my_calculator.core');\ngoog.require('cljs.core');\ngoog.require('module$private$tmp$foo-bar$clojurescript$src$test$cljs$calculator');\n" "goog.provide('my_calculator.core');\ngoog.require('cljs.core');\ngoog.require('module$private$tmp$foo_bar$clojurescript$src$test$cljs$calculator');\n")) lein test :only cljs.module-processing-tests/test-module-name-substitution FAIL in (test-module-name-substitution) (module_processing_tests.clj:128) expected: (= output (compile (quote (calc/add 3 4)))) actual: (not (= "module$private$tmp$foo-bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n" "module$private$tmp$foo_bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n")) lein test :only cljs.module-processing-tests/test-module-name-substitution FAIL in (test-module-name-substitution) (module_processing_tests.clj:129) expected: (= output (compile (quote (calculator/add 3 4)))) actual: (not (= "module$private$tmp$foo-bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n" "module$private$tmp$foo_bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n")) lein test :only cljs.module-processing-tests/test-module-name-substitution FAIL in (test-module-name-substitution) (module_processing_tests.clj:130) expected: (= output (compile (quote (add 3 4)))) actual: (not (= "module$private$tmp$foo-bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n" "module$private$tmp$foo_bar$clojurescript$src$test$cljs$calculator[\"default\"].add((3),(4));\n")) lein test :only cljs.module-processing-tests/test-module-name-substitution FAIL in (test-module-name-substitution) (module_processing_tests.clj:131) expected: (= (str (absolute-module-path "src/test/cljs/calculator.js" true) "[\"default\"].subtract((5),(4));" crlf) (compile (quote (sub 5 4)))) actual: (not (= "module$private$tmp$foo-bar$clojurescript$src$test$cljs$calculator[\"default\"].subtract((5),(4));\n" "module$private$tmp$foo_bar$clojurescript$src$test$cljs$calculator[\"default\"].subtract((5),(4));\n"))

Environment

None

Status

Assignee

David Nolen

Reporter

Mike Fikes

Labels

Approval

Accepted

Patch

Code and Test

Priority

Major
Configure