diff --git a/test/parse_ns.test.js b/test/parse_ns.test.js index 68d964a..93ecf1f 100644 --- a/test/parse_ns.test.js +++ b/test/parse_ns.test.js @@ -58,9 +58,10 @@ test('All test_parse_ns/ cases should have unique names', () => { // dev convenience: set this to true and add specific test cases // only those cases will run -const onlyRunSpecificTests = false +const onlyRunSpecificTests = true const specificTests = new Set() // specificTests.add('your test case here') +specificTests.add('GitHub Issue #38 - reader conditionals') const ignoreSomeTests = false const ignoreTests = new Set() diff --git a/test_parse_ns/parse_ns.eno b/test_parse_ns/parse_ns.eno index a913baf..d98aa17 100644 --- a/test_parse_ns/parse_ns.eno +++ b/test_parse_ns/parse_ns.eno @@ -2726,3 +2726,51 @@ ] } --Expected + +# GitHub Issue #38 - reader conditionals + +--Input +(ns com.example.my-app + #?(:clj (:refer-clojure :exclude [alter-var-root])) + (#?(:clj :require :cljs :require-macros) [alter-cljs.core :refer [alter-var-root]])) + +(alter-var-root whatever + (fn [x] + (do-something-to x))) +--Input + +--Expected +{ + "nsSymbol": "com.example.my-app", + "referClojure": { + "exclude": [ + { + "platform": ":clj", + "symbol": "alter-var-root" + } + ] + }, + "requires": [ + { + "symbol": "alter-cljs.core", + "refer": [ + { + "symbol": "alter-var-root" + } + ], + "platform": ":clj" + } + ], + "requireMacros": [ + { + "symbol": "alter-cljs.core", + "refer": [ + { + "symbol": "alter-var-root" + } + ], + "platform": ":cljs" + } + ] +} +--Expected