Skip to content

Commit

Permalink
Replace deprecated --enable-stubbing (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
celinval authored Oct 17, 2023
1 parent 13cb539 commit f73b940
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ export namespace KaniArguments {
export const testsFlag: string = `--tests`;
export const outputFormatFlag: string = `--output-format`;
export const unstableFormatFlag: string = `--enable-unstable`;
export const stubbingFlag: string = `--enable-stubbing`;
export const stubbingFlag: string = `-Z=stubbing`;
}
20 changes: 7 additions & 13 deletions src/model/kaniCommandCreate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,19 +72,13 @@ function createCommand(
testFlag: boolean = false,
stubbing_args?: boolean,
): string {
let harnessCommand = '';
if (!testFlag) {
if (stubbing_args === undefined || !stubbing_args) {
harnessCommand = `${KaniConstants.CargoKaniExecutableName} ${KaniArguments.packageFlag} ${packageName} ${KaniArguments.harnessFlag} ${harnessName}`;
} else {
harnessCommand = `${KaniConstants.CargoKaniExecutableName} ${KaniArguments.unstableFormatFlag} ${KaniArguments.stubbingFlag} ${KaniArguments.packageFlag} ${packageName} ${KaniArguments.harnessFlag} ${harnessName}`;
}
} else {
if (stubbing_args === undefined || !stubbing_args) {
harnessCommand = `${KaniConstants.CargoKaniExecutableName} ${KaniArguments.testsFlag} ${KaniArguments.packageFlag} ${packageName} ${KaniArguments.harnessFlag} ${harnessName}`;
} else {
harnessCommand = `${KaniConstants.CargoKaniExecutableName} ${KaniArguments.testsFlag} ${KaniArguments.unstableFormatFlag} ${KaniArguments.stubbingFlag} ${KaniArguments.packageFlag} ${packageName} ${KaniArguments.harnessFlag} ${harnessName}`;
}
let harnessCommand = `${KaniConstants.CargoKaniExecutableName} ${KaniArguments.packageFlag} ${packageName} ${KaniArguments.harnessFlag} ${harnessName}`;
if (testFlag) {
harnessCommand = `${harnessCommand} ${KaniArguments.testsFlag}`;
}

if (stubbing_args !== undefined && stubbing_args) {
harnessCommand = `${harnessCommand} ${KaniArguments.stubbingFlag}`;
}

return harnessCommand;
Expand Down

0 comments on commit f73b940

Please sign in to comment.