google / google/truth

Add a subject for CharSequence

Open
#535 9 comments 1 reaction 0 assignees View on GitHub
P3 type=addition
Dominant language
Java
Stars
2.8k
Forks
275
Avg merge
7m
Merged PRs (30d)
4

Description

Android mostly deals with `CharSequence` instead of `String`. Many of the `StringSubject` checks rely on the API of `CharSequence` and not `String`. Is there a reason that no subject for `CharSequence` exists? It feels like both subjects could share a lot of their implementation.

At the moment, it is necessary to call `toString()` on the sequence, what isn't that pretty.
```kotlin
val sequence: CharSequence = ""
assertThat(sequence.toString()).isEmpty()
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.