Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge clojure-mode tests into clojure-ts-mode #57

Merged
merged 209 commits into from
Oct 31, 2024

Conversation

kommen
Copy link
Contributor

@kommen kommen commented Oct 30, 2024

Attempt to address #25: Bring over the clojure-mode test suit and preserve history and contributors.

This was done:

Prepare a clone of clojure-mode with just contents of test/

$ git clone --no-checkout https://github.com/clojure-emacs/clojure-mode.git ~/work/clojure-mode-tests-only
$ cd ~/work/clojure-mode-tests-only
$ git filter-branch --subdirectory-filter test -- --all

Add it to clojure-ts-mode and merge it

$ cd ~/work/clojure-ts-mode
$ git remote add clojure-mode-tests ~/work/clojure-mode-tests-only
$ git fetch clojure-mode-tests
$ git merge --allow-unrelated-histories clojure-mode-tests/master

bbatsov and others added 30 commits May 30, 2014 22:47
Currently `foo/some-var` will fontlock `foo`, but if this item is
something that can be dereffed and you type `@foo/some-var`, `foo` is no
longer font-locked.

Similarly: `*dynamic-var*` is font locked, but `@` breaks the regex.

In this change the `@` sign isn't font locked, but the var that follows
it is.

Conflicts:
	clojure-mode.el

Add tests for dynamic-var and ns/refer fontlock
Everything appearing after the word ns was treated as
namespace (.e.g. [ns name]). Now we check if ns is preceded by a (.
E.g. clojure.lang.Var/cloneThreadBindingFrame
vemv and others added 11 commits August 23, 2023 19:20
Changes syntax highlighting regexp for keywords to match a colon/double-colon
only at the beginning of a word, not in the middle. This allows local vars like
`foo:bar` to be highlighted correctly instead of like an unknown symbol for the
part before the colon and a keyword for the rest.

Fixes #653
Must have been moved to the second line by a well-meaning fill operation.
Unfortunately, it has no effect on the second line and the tests broke on
buttercup 1.34.
* Or this will prevent buttercup tests from working with installed clojure-mode
under ELPA directories.

* A bit more background: in Debian there is autopkgtest which tests the
installed package.  dh-elpa enables a mode that runs the same ERT or Buttercup
tests against the installed package instead of the source tree.  In this case,
it will let the tests pass during build phase, but autopkgtest will fail as this
custom code will still try to locate the source code which will no longer be
available.

* I have tested under Debian sbuild that removing the code will let
the buttercup tests pass under autopkgtest, but not sure whether this is still
required for Eldev to work.
This was done:

Prepare a clone of clojure-mode with just contents of test/

```
$ git clone --no-checkout https://github.com/clojure-emacs/clojure-mode.git ~/work/clojure-mode-tests-only
$ cd ~/work/clojure-mode-tests-only
$ git filter-branch --subdirectory-filter test -- --all
```

Add it to clojure-ts-mode and merge it
```
$ cd ~/work/clojure-ts-mode
$ git remote add clojure-mode-tests ~/work/clojure-mode-tests-only
$ git fetch clojure-mode-tests
$ git merge --allow-unrelated-histories clojure-mode-tests/master
```
@bbatsov
Copy link
Member

bbatsov commented Oct 31, 2024

Seems like a step in the right direction to me.

@kommen kommen force-pushed the add-clojure-mode-tests branch 2 times, most recently from 40ee640 to 34fb609 Compare October 31, 2024 18:58
@kommen kommen marked this pull request as ready for review October 31, 2024 20:14
@kommen
Copy link
Contributor Author

kommen commented Oct 31, 2024

Got the build green by ignoring all the merged clojure-mode test files for now in eldev: So as discussed in #25 (comment), this just adds the test suite without actually running any of those tests.

One thing I was wondering: maybe put the clojure-mode-* tests into a different directory to avoid any confusion?

@bbatsov
Copy link
Member

bbatsov commented Oct 31, 2024

Yeah, I think that would be prudent and would make it easier to keep track of what needs to be updated for clojure-ts-mode.

@kommen kommen force-pushed the add-clojure-mode-tests branch from 34fb609 to 1d7f84d Compare October 31, 2024 20:39
@kommen
Copy link
Contributor Author

kommen commented Oct 31, 2024

@bbatsov done. Anything else you feel we should tackle before getting this merged?

@bbatsov bbatsov merged commit 177e8e1 into clojure-emacs:main Oct 31, 2024
3 checks passed
@bbatsov
Copy link
Member

bbatsov commented Oct 31, 2024

Nope, I think we're all good here.

@kommen kommen deleted the add-clojure-mode-tests branch October 31, 2024 20:46
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.