-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Add unit test runner for autocompletion #85178
Conversation
df43949
to
93be6e9
Compare
550ecb9
to
321e9d9
Compare
Just noticed that there is no Github CI that runs tests with mono enabled. Would this be possible? I see no reliable way to test auto completion with |
This is because of issues, see the workflow file comment:
|
0896819
to
505d617
Compare
I've tested running a few times with the tests enabled and don't see any freezing, but I think this should be enabled and tested extensively in a separate PR to avoid any problems, see here for the original reason |
505d617
to
91735ec
Compare
d96e4ee
to
1afe201
Compare
This should be ready for a first round of review now, since I added the features which I wanted to add. What still remains to do:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, seems to pass tests and the tests makes sense to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea itself looks good to me, I just found some small details.
I also wonder if we can have an easy way to create the cfg
files since writing them by hand might be tricky and prone to typos, especially if they get big (though tests should probably be small anyway).
var test = 1 | ||
|
||
func _ready(): | ||
$N |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This 0xFFFF
character might be annoying to add as there is no an easy way to insert it besides copying and pasting, and it's inconsistent how it's shown across editors. Though I can't think of a better alternative for this at the moment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could choose some UTF8 emoji and replace it with 0xFFFF. The use of this emoji in the test would just be banned. Maybe ➡️ or 🖱️. But I'm not sure whether there could be problems because those emojis are longer then normal characters.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up using ➡. It doesn't solve the need for copy and pasting, but it should be correctly displayed by most editors.
Edit: I also thought about → or ⇒ since, at least on some systems they can be entered through the compose key (e.g. mine 😄). But some editors display ->
/=>
in the same (or a very similar) way. So I think it might get too confusing.
Thanks for working on this, BTW. It is something on my mind for a while so I'm glad to have tests for completion. |
Generating them through CLI like the other GDScript test would be quite inconvenient I think. It sounds more like an entry for the tools menu which gives you some UI that allows to configure the test and spits out the cfg and maybe also the script with the inserted sentinel char. But since it would be dev only, having it in the menu seems wrong. Maybe I will write a little editor plugin for it, but that is something to think about when actually writing test cases. I can also imagine that copy and pasting an existing cfg will be quite sufficient for most cases. |
63782e7
to
18ecc2d
Compare
ddb7e2b
to
6f18cca
Compare
ea65bd2
to
d7c9ebe
Compare
d7c9ebe
to
08b880c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
08b880c
to
af4cbaf
Compare
Thanks! |
To prevent GDScript changes from breaking auto completion capabilities.