Skip to content

Conversation

E-A-Griffin
Copy link
Collaborator

@E-A-Griffin E-A-Griffin commented Sep 6, 2025

This fixes redundant requiring of clojure.core and qualifying of vars v in clojure.core as clojure.core/v

Clojure.core template now

(ns clojure.core-test.baz
  (:require [clojure.test :as t :refer [deftest testing is are]]
            [clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]]))

(when-var-exists baz
  (deftest test-baz
    ;; `testing` sections are optional, depending on how you want to
    ;; structure your tests. If you have a lot of tests and they group
    ;; together in subgroups, then use `testing`. The `testing` form
    ;; can also be a nice way to group tests that only apply to a
    ;; subset of Clojure implementations. These can then be guarded by
    ;; reader conditionals.
    (testing "section name"
      (is (= 1 0)))))

And non clojure.core sections should be unchanged

(ns clojure.string-test.bat
  (:require clojure.string
            [clojure.test :as t :refer [deftest testing is are]]
            [clojure.core-test.portability #?(:cljs :refer-macros :default :refer) [when-var-exists]]))

(when-var-exists clojure.string/bat
  (deftest test-bat
    ;; `testing` sections are optional, depending on how you want to
    ;; structure your tests. If you have a lot of tests and they group
    ;; together in subgroups, then use `testing`. The `testing` form
    ;; can also be a nice way to group tests that only apply to a
    ;; subset of Clojure implementations. These can then be guarded by
    ;; reader conditionals.
    (testing "section name"
      (is (= 1 0)))))

@jeaye
Copy link
Member

jeaye commented Sep 7, 2025

We never need to require clojure.core, though, even for the non-core tests. ns does that for us. I think we should remove it from all.

@E-A-Griffin
Copy link
Collaborator Author

It looks like for non clojure.core nses n it requires n instead of clojure.core (see the clojure.string example) unless I'm missing something, so this would still be useful?

@jeaye
Copy link
Member

jeaye commented Sep 7, 2025

It looks like for non clojure.core nses n it requires n instead of clojure.core (see the clojure.string example) unless I'm missing something, so this would still be useful?

Yeah, you're right. I guess we can tolerate that. 🙃

@jeaye jeaye merged commit fc93f9a into jank-lang:main Sep 7, 2025
2 checks passed
@jeaye
Copy link
Member

jeaye commented Sep 7, 2025

Thanks for all the help in this repo, Emma. We really needed someone to help drive this, but I didn't realize it until you did it. ☺️

@E-A-Griffin
Copy link
Collaborator Author

Awe thanks, it's been a lot of fun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants