mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 19:28:05 +01:00
Fix operator order in metric calculation
This commit is contained in:
committed by
ravi-signal
parent
61b3cecd17
commit
2e497b5834
@@ -5,6 +5,7 @@
|
||||
|
||||
package org.whispersystems.textsecuregcm.recaptcha;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static org.whispersystems.textsecuregcm.recaptcha.RecaptchaClient.SEPARATOR;
|
||||
@@ -43,6 +44,21 @@ class RecaptchaClientTest {
|
||||
});
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource
|
||||
void scoreString(float score, String expected) {
|
||||
assertThat(RecaptchaClient.scoreString(score)).isEqualTo(expected);
|
||||
}
|
||||
|
||||
static Stream<Arguments> scoreString() {
|
||||
return Stream.of(
|
||||
Arguments.of(0.3f, "30"),
|
||||
Arguments.of(0.0f, "0"),
|
||||
Arguments.of(0.333f, "33"),
|
||||
Arguments.of(Float.NaN, "0")
|
||||
);
|
||||
}
|
||||
|
||||
static Stream<Arguments> parseInputToken() {
|
||||
return Stream.of(
|
||||
Arguments.of(
|
||||
|
||||
Reference in New Issue
Block a user