Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Added some more test cases to strings.xml.#5

Closed
danielkutik wants to merge 1 commit intoJakeWharton:masterfrom
danielkutik:strings-xml
Closed

Added some more test cases to strings.xml.#5
danielkutik wants to merge 1 commit intoJakeWharton:masterfrom
danielkutik:strings-xml

Conversation

@danielkutik
Copy link
Copy Markdown
Contributor

I added a couple more strings and documentation to the strings.xml file:

  1. A comment/documentation for an ignored string
  2. A string that was commented out
  3. A comment that spreads over two lines...
  4. ... and an item which is one token and nothing else, additionally what would happen if the token is named equals(...)!?

@JakeWharton
Copy link
Copy Markdown
Owner

I'm not going to merge this for one big reason: we have no way to test these. There needs to be unit tests for the Java code of the plugin which verify parsing of comments and things so that we can actually verify behavior.

These are good cases to look at, we just need to get them in real tests that exercise them.

Here's some answers to your questions, though:

A comment/documentation for an ignored string

Should be fine.

A string that was commented out

If directly above another element without its own documentation it would be parsed as its documentation.

A comment that spreads over two lines...

I can't remember for sure, but the rules of things like this is that nearest comment wins. The first line wouldn't be included. As I said in #4, parsing will be part of the Android plugin so it's whatever they choose.

what would happen if the token is named equals(...)!?

Nothing. The equals method takes an Object as its argument and since we use CharSequence it will not override.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants