-
Notifications
You must be signed in to change notification settings - Fork 381
Small patch, adding CharSequence::isEmpty #10097
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
Conversation
Thanks for the contribution - would you add a "quick" test for this? The test method itself should be quick (empty string, non-empty string, maybe mutate a StringBuilder to be empty, then non-empty, then empty again), but setting up the test is going to be a little irritating to add since the test won't compile with Java 11, it will need to have super-source.
|
Ok, will have a look when some free time is at hand, |
Hi, I implement the tests as instructed. Then I tried to let them run according to the instructions in the README.md. Using Java 21:
My new I checked where I created a corresponding I also checked if The java11 StringTest seems also not to be listed (probably not called?) in the output = ? I set my test up to fail:
(Also broke The output of the ant-call was the same. I then tried to set up Ich checked if Finally, as I might have broken something, I reverted my changes back and ran the tests on the original repo:
Exactly the same thing. I tried to run "all" tests without "user" prefix - to make sure every single one should be run. Any ideas? |
Would you push the commit with the draft test so I can take a look there, give it a try? The way I run tests is usually based on the table, cd'ing into the directory and running a task or two, like this:
that will run every test with that name in user/ with htmlunit, with a production build (rather than draft, or disabling class metadata) - for a simple emulation test like this, that should be sufficient. With your own github fork, you can also push a branch name with a I'm very far from an ant expert, and as far as I can tell that As to why those tests are failing for you locally, I'm not sure, do you want to open a separate issue for that? I would guess there is a windows specific issue with how the tests are defined. |
Also if you are using macOS some tests will simply fail, because Java on macOS has a bad implementation of |
Hi. With
(it is " under Windows, otherwise straight into hell) and a few other modifications I got it to run. Only flaw still is, that the override CharSequenceTest is never used (breaking the test there has no effect). I didn't use your folder structure proposal because I found another one quite similar but not identical. Maybe you can have a look. @jnehlmeier |
Thank you for keeping at this - there is a typo that prevents your test from working. In the "regular" version of the CharSequenceTest, you placed it in |
I had to add the stub under com.google.gwt.emultest.java.lang as well. So you think moving the supersourced version to java.lang solves this? |
The stub in the test/ directory must exist since Java 11 can't compile this test, so instead Java 11 sees the stub. With the addition of your supersource to the CharSequence type, the super-test/ code will be able to compile with references to Java 15 methods, even on Java 11. The fully-qualified name of the class must match in both test/ and super-test/, and for EmulSuite to reference the class, it too must match the same name. For these purposes at least, the actual name doesn't matter, as long as all three locations are the same. However, to keep track of "when can we un-supersource this test" and which tests belong where, we prefer tests to be named for the version of Java they are based on. So, the |
Sorry, I didn't get what needs to be done now. |
Your user/test-super/ implementation is in package You've already updated the EmulSuite.gwt.xml to reference the java15 package as including sources, so that should be sufficient from what I can see here. |
Hm, I'm pretty sure that didn't work. Thats why I also copied the stub to java (without 15). |
As above, we'd really prefer |
I moved the tests to the requested java17 - paths and broke the super implementation. So still the problem, that it is not executed. |
#10106 has the super-sourced tests for Java 17 emulation. |
@zbynek Yes, just go ahead 👍 |
Now part of #10106 |
Fixes #10091