Skip to content

Commit

Permalink
added extra test case
Browse files Browse the repository at this point in the history
  • Loading branch information
Janther committed Sep 27, 2024
1 parent 9159c66 commit 176d481
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ describe("inferLanguage", function () {
})
}

test("should use the latest version if the source has no pragmas", function () {
test("should use the latest valid version if the source has no pragmas", function () {
const supportedVersions = Language.supportedVersions();
const latestSupportedVersion = supportedVersions[supportedVersions.length - 1];
const inferredLanguage = inferLanguage(`contract Foo {}`);
let inferredLanguage = inferLanguage(`contract Foo {}`);
expect(inferredLanguage.version).toEqual(latestSupportedVersion);
inferredLanguage = inferLanguage(`contract Foo {byte bar;}`);
expect(inferredLanguage.version).toEqual('0.7.6');
})

test.skip('should throw an error if there are incompatible ranges', function () {
Expand Down

0 comments on commit 176d481

Please sign in to comment.