Skip to content

Commit

Permalink
unit tests in java
Browse files Browse the repository at this point in the history
  • Loading branch information
kuhe committed Jun 24, 2024
1 parent 0fea87f commit 67940c6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 33 deletions.
2 changes: 0 additions & 2 deletions packages/core/src/submodules/cbor/cbor-encode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ export function encode(_input: any): void {
continue;
} else if (typeof input === "number") {
if (Number.isInteger(input)) {
// this section is inlined duplicate for performance.
const major = input >= 0 ? majorUint64 : majorNegativeInt64;
const value = input >= 0 ? input : -input - 1;
if (value < 24) {
Expand Down Expand Up @@ -148,7 +147,6 @@ export function encode(_input: any): void {
const major = input >= 0 ? majorUint64 : majorNegativeInt64;
const value = input >= 0 ? input : -input - BigInt(1);
const n = Number(value);
// this section is inlined duplicate for performance.
if (n < 24) {
data[cursor++] = (major << 5) | n;
} else if (n < 256 /* 2 ** 8 */) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,54 +147,38 @@ public enum TypeScriptDependency implements Dependency {
public final String packageName;
public final String version;
public final SymbolDependency dependency;
private String importName;

TypeScriptDependency(String type, String packageName, boolean unconditional) {
TypeScriptDependency(String type, String name, boolean unconditional) {
String version;
if (packageName.startsWith("@aws-sdk/")) {
version = SdkVersion.getVersion(packageName);
if (name.startsWith("@aws-sdk/")) {
version = SdkVersion.getVersion(name);
} else {
version = DependencyVersion.getVersion(packageName);
version = DependencyVersion.getVersion(name);
}

if (packageName.startsWith("@smithy/")) {
if (name.startsWith("@smithy/")) {
version = "^" + version;
}
this.dependency = SymbolDependency.builder()
.dependencyType(type)
.packageName(packageName)
.packageName(name)
.version(version)
.putProperty("unconditional", unconditional)
.build();
this.packageName = packageName;
this.packageName = name;
this.version = version;
this.importName = packageName;

}

TypeScriptDependency(String type, String packageName, String version, boolean unconditional) {
TypeScriptDependency(String type, String name, String version, boolean unconditional) {
this.dependency = SymbolDependency.builder()
.dependencyType(type)
.packageName(packageName)
.packageName(name)
.version(version)
.putProperty("unconditional", unconditional)
.build();
this.packageName = packageName;
this.packageName = name;
this.version = version;
this.importName = packageName;
}

TypeScriptDependency(String type, String packageName, boolean unconditional, String importName) {
this(type, packageName, unconditional);
this.importName = importName;
}

TypeScriptDependency(String type,
String packageName,
String version,
boolean unconditional,
String importName) {
this(type, packageName, version, unconditional);
this.importName = importName;
}

/**
Expand Down Expand Up @@ -229,10 +213,6 @@ public String getPackageName() {
return this.packageName;
}

public String getImportName() {
return this.importName;
}

/**
* Creates a Symbol from the dependency of the enum, using the package
* name and version of the dependency and the provided {@code name}.
Expand Down

0 comments on commit 67940c6

Please sign in to comment.