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

Use unencoded names for selectors to improve Xcode test reports #1167

Closed
wants to merge 4 commits into from

Conversation

bnickel
Copy link
Contributor

@bnickel bnickel commented Sep 2, 2022

This idea is a little half baked but, a selector can be any finite UTF-8-encodable string, so why do we need to call c99ExtendedIdentifier? (Even : is meaningless to the runtime.)

If we omit it the transformation, the test sidebar and results views become a lot more readable:

screenshot of the test inspector with normal test names

screenshot of the test sidebar with full names

We can also make the test console slightly prettier by overriding the undocumented nameForLegacyLogging property to omit the class name:

Test Suite 'Selected tests' started at 2022-09-02 14:11:13.591
Test Suite 'QuickTests.xctest' started at 2022-09-02 14:11:13.592
Test Suite 'FunctionalTests_ItSpec' started at 2022-09-02 14:11:13.593
Test Case 'has a description with セレクター名に使えない文字が入っている 👊💥' started.
Test Case 'has a description with セレクター名に使えない文字が入っている 👊💥' passed (0.002 seconds).
Test Suite 'FunctionalTests_ItSpec' passed at 2022-09-02 14:11:13.595.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.002) seconds
Test Suite 'QuickTests.xctest' passed at 2022-09-02 14:11:13.595.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.003) seconds
Test Suite 'Selected tests' passed at 2022-09-02 14:11:13.595.
	 Executed 1 test, with 0 failures (0 unexpected) in 0.002 (0.004) seconds
Program ended with exit code: 0

Checklist - While not every PR needs it, new features should consider this list:

  • Does this have tests?
  • Does this have documentation?
  • Does this break the public API (Requires major version bump)?
  • Is this a new feature (Requires minor version bump)?

@younata
Copy link
Member

younata commented Apr 23, 2023

Thank you so much @bnickel! I took this and added it as part of the next version of Quick. Really appreciate the work and idea.

@younata younata closed this Apr 23, 2023
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.

None yet

2 participants