Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Nov 2, 2023
1 parent f7c8069 commit e27cd3e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 63 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,8 @@ static String DoVoidOperation(DafnyVersion dafnyVersion) {
static String MockKmsShim = """
package software.amazon.cryptography.services.kms.internaldafny;
import Wrappers_Compile.Option;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import dafny.Tuple0;
import java.lang.Boolean;
import java.lang.Character;
import java.lang.Override;
import java.lang.String;
import software.amazon.awssdk.services.kms.KmsClient;
Expand All @@ -108,32 +104,6 @@ public Shim(final KmsClient impl, final String region) {
this.region = region;
}
public static Result<IKeyManagementServiceClient, Error> createSuccessOfClient(
IKeyManagementServiceClient client) {
return Result.create_Success(client);
}
public static Result<IKeyManagementServiceClient, Error> createFailureOfError(Error error) {
return Result.create_Failure(error);
}
public static Option<DafnySequence<? extends Character>> createStringSome(
DafnySequence<? extends Character> s) {
return Option.create_Some(s);
}
public static Option<DafnySequence<? extends Character>> createStringNone() {
return Option.create_None();
}
public static Option<Boolean> createBooleanSome(Boolean b) {
return Option.create_Some(b);
}
public static Option<Boolean> createBooleanNone() {
return Option.create_None();
}
public KmsClient impl() {
return this._impl;
}
Expand All @@ -150,13 +120,8 @@ public String region() {
static String MockKmsShimWithTypeDescriptors = """
package software.amazon.cryptography.services.kms.internaldafny;
import Wrappers_Compile.Option;
import Wrappers_Compile.Result;
import dafny.DafnySequence;
import dafny.Tuple0;
import dafny.TypeDescriptor;
import java.lang.Boolean;
import java.lang.Character;
import java.lang.Override;
import java.lang.String;
import software.amazon.awssdk.services.kms.KmsClient;
Expand All @@ -178,32 +143,6 @@ public Shim(final KmsClient impl, final String region) {
this.region = region;
}
public static Result<IKeyManagementServiceClient, Error> createSuccessOfClient(
IKeyManagementServiceClient client) {
return Result.create_Success(TypeDescriptor.reference(IKeyManagementServiceClient.class), Error._typeDescriptor(), client);
}
public static Result<IKeyManagementServiceClient, Error> createFailureOfError(Error error) {
return Result.create_Failure(TypeDescriptor.reference(IKeyManagementServiceClient.class), Error._typeDescriptor(), error);
}
public static Option<DafnySequence<? extends Character>> createStringSome(
DafnySequence<? extends Character> s) {
return Option.create_Some(DafnySequence._typeDescriptor(TypeDescriptor.CHAR), s);
}
public static Option<DafnySequence<? extends Character>> createStringNone() {
return Option.create_None(DafnySequence._typeDescriptor(TypeDescriptor.CHAR));
}
public static Option<Boolean> createBooleanSome(Boolean b) {
return Option.create_Some(TypeDescriptor.BOOLEAN, b);
}
public static Option<Boolean> createBooleanNone() {
return Option.create_None(TypeDescriptor.BOOLEAN);
}
public KmsClient impl() {
return this._impl;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ public void generate() {
assertEquals(expectedPath, actualPath);
final String actualSource = actual.get(actualPath).toString();
final String mockKmsShim = MockKmsShim(dafnyVersion);
System.out.println(actualSource);
System.out.print(mockKmsShim);
Tokenizer.tokenizeAndAssertEqual(mockKmsShim, actualSource);
}
}

0 comments on commit e27cd3e

Please sign in to comment.