mirror of
https://codeberg.org/PGPainless/sop-java.git
synced 2025-09-09 10:19:47 +02:00
Implement sop version --sop-spec
This commit is contained in:
parent
dfce1ad6bb
commit
f49c16e4c5
4 changed files with 45 additions and 0 deletions
|
@ -46,4 +46,14 @@ public interface Version {
|
|||
* @return extended version string
|
||||
*/
|
||||
String getExtendedVersion();
|
||||
|
||||
/**
|
||||
* Return the revision of the SOP specification that this implementation is implementing, for example,
|
||||
* <pre>draft-dkg-openpgp-stateless-cli-06</pre>.
|
||||
* If the implementation targets a specific draft but the implementer knows the implementation is incomplete,
|
||||
* it should prefix the draft title with a "~" (TILDE, U+007E), for example: <pre>~draft-dkg-openpgp-stateless-cli-06</pre>.
|
||||
*
|
||||
* @return implemented SOP spec version
|
||||
*/
|
||||
String getSopSpecVersion();
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import java.util.stream.Stream;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
|
||||
@EnabledIf("sop.testsuite.operation.AbstractSOPTest#hasBackends")
|
||||
public class VersionTest extends AbstractSOPTest {
|
||||
|
@ -51,4 +52,11 @@ public class VersionTest extends AbstractSOPTest {
|
|||
assertFalse(extended.isEmpty());
|
||||
}
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource("provideInstances")
|
||||
public void sopSpecVersionTest(SOP sop) {
|
||||
String sopSpec = sop.version().getSopSpecVersion();
|
||||
assertTrue(sopSpec.startsWith("draft-dkg-openpgp-stateless-cli-") ||
|
||||
sopSpec.startsWith("~draft-dkg-openpgp-stateless-cli-"));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue