Skip to content

Collection functions#8

Merged
borkdude merged 6 commits intosquint-cljs:mainfrom
lilactown:lilactown/coll-fns
Aug 14, 2022
Merged

Collection functions#8
borkdude merged 6 commits intosquint-cljs:mainfrom
lilactown:lilactown/coll-fns

Conversation

@lilactown
Copy link
Copy Markdown
Collaborator

@lilactown lilactown commented Aug 14, 2022

Related to #7

Adds the follow functions for working with JS collections immutably:

  • assoc on objects
  • dissoc on objects
  • conj on objects, arrays and sets
  • disj on sets

Also adds the following mutable JS functions:

  • conj!
  • disj!

Also randomly adds inc because I wanted to

@borkdude borkdude merged commit 06e7883 into squint-cljs:main Aug 14, 2022
borkdude added a commit that referenced this pull request Dec 24, 2022
borkdude added a commit that referenced this pull request Dec 24, 2022
borkdude pushed a commit that referenced this pull request Dec 24, 2022
borkdude added a commit that referenced this pull request Dec 24, 2022
borkdude added a commit that referenced this pull request Dec 24, 2022
borkdude added a commit that referenced this pull request Apr 17, 2026
Adds core-async to the built-in test macros: (async done body)
expands to (js/Promise. (fn [done] body)). The deftest body returns
the Promise and test-var awaits it, so no ^:async marker on the
outer fn is needed. Lets users copy-paste cljs.test code that uses
the (async done ...) idiom without rewriting it.

Also added to builtin-refer-is-macro? so :refer [async] doesn't
emit a runtime import. Smoke test gets a regression. CHANGELOG and
TODO entries updated (#8 closed).
borkdude added a commit that referenced this pull request Apr 17, 2026
Adds core-async to the built-in test macros: (async done body)
expands to (js/Promise. (fn [done] body)). The deftest body returns
the Promise and test-var awaits it, so no ^:async marker on the
outer fn is needed. Lets users copy-paste cljs.test code that uses
the (async done ...) idiom without rewriting it.

Also added to builtin-refer-is-macro? so :refer [async] doesn't
emit a runtime import. Smoke test gets a regression. CHANGELOG and
TODO entries updated (#8 closed).
borkdude added a commit that referenced this pull request Apr 17, 2026
* run-tests: accept quoted ns symbols at the macro level + ns event

The macro now converts (quote my.ns) at the call site to a plain
"my.ns" string before emitting, so users can write the cljs.test
idiom (run-tests 'my.ns) without depending on squint's quoted-symbol
runtime support (which doesn't exist). The runtime fn keeps its
existing signatures.

run-vars-with-once-fixtures now brackets each ns's tests with
:begin-test-ns / :end-test-ns reports — the events were declared in
report's case but never fired. Reporters (and plain output) now
print "Testing my.ns" before each ns's run, matching cljs.test.

Smoke test gains a regression for the quoted-symbol macro path and
asserts the Testing lines appear in output. CHANGELOG updated with
the user-visible cljs.test entry.

* Add (async done body) macro for cljs.test parity

Adds core-async to the built-in test macros: (async done body)
expands to (js/Promise. (fn [done] body)). The deftest body returns
the Promise and test-var awaits it, so no ^:async marker on the
outer fn is needed. Lets users copy-paste cljs.test code that uses
the (async done ...) idiom without rewriting it.

Also added to builtin-refer-is-macro? so :refer [async] doesn't
emit a runtime import. Smoke test gets a regression. CHANGELOG and
TODO entries updated (#8 closed).
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