svaante / dape

Debug Adapter Protocol for Emacs
GNU General Public License v3.0
455 stars 25 forks source link

Initial erc tests #35

Closed svaante closed 8 months ago

svaante commented 9 months ago

Basis for tests discussion

joaotavora commented 9 months ago

You know what you be a really good idea this early in the dape-test.el file? Namespaces. I.e. make the new definitions of dape-test.el start with the prefix dape-test- (or dape-test--). Then it would be much easier to track what bits of dape.el you are actually probing/exercising.

I didn't do this for eglot-tests.el and I kind of regret it: it's a bit of a mess that periodically bites me.

Of course, I can hear you say already "but typing dape-tests-- everytime is a pain!! I'll never remember to do it" And if you are saying that I fully agree. So you could use shorthands in this file, they are supported since Emacs 28 and some extensions out there are using it.

So something like this footer in dape-test.el

;; Local Variables:
;; read-symbol-shorthands: (("dt-" . "dape-tests-"))
;; End:

All the symbols are still named dape-tests-<foo> but you can type them (in this file only, of course) as dt- (or test- or daniel- or t- or whatever you prefer).

joaotavora commented 9 months ago

Follow emacs make test target naming

Speaking of convention, another reasonably arbitrary one is that the file containing tests for package foo.el is named foo-tests.el plural, not foo-test.el. So if there's no good reason not to, I'd switch to that too.

joaotavora commented 9 months ago

Speaking of convention, another reasonably arbitrary one is that the file containing tests for package foo.el is named foo-tests.el plural, not foo-test.el. So if there's no good reason not to, I'd switch to that too.

Duh, nevermind, you already have it like that. 🤦

svaante commented 9 months ago

You know what you be a really good idea this early in the dape-test.el file? Namespaces. I.e. make the new definitions of dape-test.el start with the prefix dape-test- (or dape-test--). Then it would be much easier to track what bits of dape.el you are actually probing/exercising.

I didn't do this for eglot-tests.el and I kind of regret it: it's a bit of a mess that periodically bites me.

Of course, I can hear you say already "but typing dape-tests-- everytime is a pain!! I'll never remember to do it" And if you are saying that I fully agree. So you could use shorthands in this file, they are supported since Emacs 28 and some extensions out there are using it.

So something like this footer in dape-test.el

;; Local Variables:
;; read-symbol-shorthands: (("dt-" . "dape-tests-"))
;; End:

All the symbols are still named dape-tests-<foo> but you can type them (in this file only, of course) as dt- (or test- or daniel- or t- or whatever you prefer).

Will do, makes sense. Is this the best diss I have ever received daniel-? Im hoping you are referring to what I think you are referring to.

joaotavora commented 9 months ago

is this the best diss I have ever received daniel-

I'm lost :grimacing: You are Daniel right? (Or Svante?) I just meant daniel- as an example of the shorthand prefix you can use, like I could use joao-, but the actual symbols would be dape-test-foo. Sorry, I didn't mean to diss at all