google / google/truth

Provide PrimitiveIntArraySubject.asList().containsExactlyElementsIn(int[]), etc.?

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

Description

Seems worth a look, since we have similar methods on `PrimitiveDoubleArraySubject` and `PrimitiveFloatArraySubject`? But we'd have to look to establish demand.

And there's also the possibility that we'd make `PrimitiveIntArraySubject` and friends directly _contain_ methods like `containsExactly`, in which case we'd want to add the methods there. But maybe that possibility keeps us from wanting to extend `asList()` further.

(RE: compatibility: We could extend `asList()` in a binary-compatible way by injecting a bridge method, as we do in places in Guava. This would let us change it to return a more specific type (with the new methods) while remaining compatible with existing callers)

This was prompted by https://github.com/google/truth/issues/570... which points out that our existing methods for `double[]` and `float[]` are misnamed :\

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.