Skip to content

Conversation

dmiller
Copy link
Contributor

@dmiller dmiller commented Sep 5, 2025

No description provided.

@dmiller
Copy link
Contributor Author

dmiller commented Sep 5, 2025

The failing test in shuffle does not happen on my system.

You'll want to take a close at the changes. I had to do some non-trivial rearrangement in the string library tests.

Also, for with-out-str, I had to introduce a helper function from clojure.test-helpers. I could not figure out how to :require or :use that library. (Both ClojureJVM and ClojureCLR use it in their test suites.)

@jeaye
Copy link
Member

jeaye commented Sep 5, 2025

Thanks, David! I'll leave this for @E-A-Griffin to help with, both for the copied code (can we avoid it?) and the failing test.

@E-A-Griffin
Copy link
Contributor

Will run tonight

deps-clr.edn Outdated
@@ -0,0 +1,11 @@
{:deps {}

:aliases
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

weird spacing and indentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix as you wish.
a copy of a copy of a copy from somewhere someone else used the test-runner

deps-clr.edn Outdated
{:test
{:extra-paths ["test"]
:extra-deps {io.github.dmiller/test-runner {:git/sha "c055ea13d19c6a9b9632aa2370fcc2215c8043c3"}}
;; :main-opts {"-m" "cognitect.test-runner" "-d" "test"}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could we drop this dead code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes.

0 0
127 127
1 1N
0 0N
-1 -1N
#?@(:cljr [] :default [-1 -1N])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing is weird

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had just inserted the original code in the :default case.
Format as you see fit, for sure.

1 1.0M
0 0.0M
-1 -1.0M
#?@(:cljr [] :default [-1 -1.0M])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing is weird

1 1.1M
-1 -1.1M]))
#?@(:cljr [] :default [-1 -1.1M])]))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing is weird for each of these

(is (thrown? Exception (byte -128.000001)))
(is (thrown? Exception (byte -129)))
(is (= 128 (byte 128)))
(is (= 127(byte 127.000001)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing is weird

(defn platform-newlines [s] (.Replace ^String s "\n" nl))) ;;; .replace, add type hint
:clj
(let [nl (System/getProperty "line.separator")]
(defn platform-newlines [s] (.replace s "\n" nl)))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style nitpick but I think it'd be cleaner to have the var defined with a defn at the top level for all implementations and then change the body based on platform, i.e.

(defn platform-newlines [s]
  #?(:clj
     (let [nl (System/getProperty "line.separator")]
       (.replace s "\n" nl))
     :cljr
     (let [nl Environment/NewLine]           ;;; (System/getProperty "line.separator")] 
       (.Replace ^String s "\n" nl)))        ;;; .replace, add type hint
     :default
     s)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

(is (#?(:cljs true? :cljr true :default false?) (str/blank? " ")))
(is (#?(:cljs true? :cljr true :default false?) (str/blank? "\u2007"))))
(is (#?(:cljs true? :cljr true? :default false?) (str/blank? " ")))
(is (#?(:cljs true? :cljr true? :default false?) (str/blank? "\u2007"))))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spacing is weird here

deps-clr.edn Outdated
;; :main-opts {"-m" "cognitect.test-runner" "-d" "test"}
:exec-fn cognitect.test-runner.api/test
:exec-args {:dirs ["test"]
:patterns [".*test.*"]}}}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this will work, most namespaces don't have test in the name

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are probably right, though i think all tests were running for me. I think you can just leave out the :patterns.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll try it again but it didn't work for me when I tried this last night

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this works, thanks!

@E-A-Griffin
Copy link
Contributor

@dmiller this is what I got

Ran 172 tests containing 3949 assertions.
40 failures, 24 errors.

@E-A-Griffin
Copy link
Contributor

@dmiller I can push the changes if you're able to give me write access to your fork so I can push updates to your branch (otherwise I think I'd need to fork your fork which seems excessive)

@dmiller
Copy link
Contributor Author

dmiller commented Sep 6, 2025 via email

Copy link
Contributor

@E-A-Griffin E-A-Griffin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still some failing CLR tests (on my end, not sure if @dmiller has any failures) but I think we can clean those up later, I'm happy to take a further look in a follow up but this is blocking multiple PRs so I think better to get it through and make incremental progress

@E-A-Griffin
Copy link
Contributor

@jeaye ^ left my approval with a note, if you want to take a look

@jeaye
Copy link
Member

jeaye commented Sep 7, 2025

@jeaye ^ left my approval with a note, if you want to take a look

Thanks, Emma. We can't merge failing tests, since we need CI on main to be passing (and we need CI on this PR to be passing prior to merging). If there's anything currently failing which we plan on tackling in the future, we can disable that code with a #_ or similar, along with a comment regarding the issue and intention to fix.

@dmiller
Copy link
Contributor Author

dmiller commented Sep 7, 2025 via email

@E-A-Griffin
Copy link
Contributor

@dmiller if the tests are passing on your end then it's probably an issue on my local

@E-A-Griffin
Copy link
Contributor

@jeaye okay, this time for real I think it's ready

Copy link
Member

@jeaye jeaye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job, both of you!

@jeaye jeaye merged commit a54a567 into jank-lang:main Sep 9, 2025
2 checks passed
@dmiller
Copy link
Contributor Author

dmiller commented Sep 9, 2025 via email

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.

3 participants