Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ To upgrade the version of the lib2813 libraries you are using, simply update the
- `com.team2813.lib2813:vendor-rev`:
- `REVLib.json`
- `com.team2813.lib2813:limelight`:
- `Phoenix6.json`
- none
- `com.team2813.lib2813:vision`:
- `photonlib.json`
- `com.team2813.lib2813:testing`:
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
*/

rootProject.name = 'lib2813'
gradle.ext.lib_version = "2.0.0"
gradle.ext.lib_version = "2.1.0"
include 'core', 'limelight', 'vision', 'testing'
include 'vendor:ctre', 'vendor:rev'
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@ private MeasureSubject(FailureMetadata failureMetadata, @Nullable Measure<U> sub
this.actual = subject;
}

/**
* Prepares for a check that the actual value is within the given tolerance of an expected value
* that will be provided in the next call in the fluent chain.
*
* @param tolerance an inclusive upper bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
*/
public TolerantComparison<Measure<U>> isWithin(Measure<U> tolerance) {
return new TolerantComparison<Measure<U>>() {
@Override
Expand All @@ -67,6 +74,13 @@ public void of(Measure<U> expected) {
};
}

/**
* Prepares for a check that the actual value is not within the given tolerance of an expected
* value that will be provided in the next call in the fluent chain.
*
* @param tolerance an exclusive lower bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
*/
public TolerantComparison<Measure<U>> isNotWithin(Measure<U> tolerance) {
return new TolerantComparison<Measure<U>>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ private Rotation2dSubject(FailureMetadata failureMetadata, @Nullable Rotation2d

// User-defined test assertion SPI below this point

/**
* Prepares for a check that the actual value is within the given tolerance of an expected value
* that will be provided in the next call in the fluent chain.
*
* @param tolerance an inclusive upper bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
* @since 2.1.0
*/
public TolerantComparison<Rotation2d> isWithin(double tolerance) {
return new TolerantComparison<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ private Translation2dSubject(FailureMetadata failureMetadata, @Nullable Translat

// User-defined test assertion SPI below this point

/**
* Prepares for a check that the actual value is within the given tolerance of an expected value
* that will be provided in the next call in the fluent chain.
*
* @param tolerance an inclusive upper bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
*/
public TolerantComparison<Translation2d> isWithin(double tolerance) {
return new TolerantComparison<>() {
@Override
Expand All @@ -70,6 +77,14 @@ public void of(Translation2d expected) {
};
}

/**
* Prepares for a check that the actual value is not within the given tolerance of an expected
* value that will be provided in the next call in the fluent chain.
*
* @param tolerance an exclusive lower bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
* @since 2.1.0
*/
public TolerantComparison<Translation2d> isNotWithin(double tolerance) {
return new TolerantComparison<>() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ private Translation3dSubject(FailureMetadata failureMetadata, @Nullable Translat

// User-defined test assertion SPI below this point

/**
* Prepares for a check that the actual value is within the given tolerance of an expected value
* that will be provided in the next call in the fluent chain.
*
* @param tolerance an inclusive upper bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
*/
public TolerantComparison<Translation3d> isWithin(double tolerance) {
return new TolerantComparison<>() {
@Override
Expand All @@ -70,6 +77,14 @@ public void of(Translation3d expected) {
};
}

/**
* Prepares for a check that the actual value is not within the given tolerance of an expected
* value that will be provided in the next call in the fluent chain.
*
* @param tolerance an exclusive lower bound on the difference between the actual value and
* expected value allowed by the check, which must be a non-negative value.
* @since 2.1.0
*/
public TolerantComparison<Translation3d> isNotWithin(double tolerance) {
return new TolerantComparison<>() {
@Override
Expand Down
Loading