-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #318 from fwal/fwal/fix-version-lookup
Improved version lookup
- Loading branch information
Showing
2 changed files
with
34 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { versionFromString } from "../src/get-version"; | ||
|
||
describe("version lookup", () => { | ||
it("identifies version from swift version", async () => { | ||
const version = versionFromString( | ||
"Apple Swift version 5.4.2 (swiftlang-1205.0.28.2 clang-1205.0.19.57)" | ||
); | ||
expect(version).toBe("5.4.2"); | ||
}); | ||
|
||
it("identifies version from swift version with target", async () => { | ||
const version = versionFromString( | ||
`Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1) | ||
Target: x86_64-apple-macosx11.0` | ||
); | ||
expect(version).toBe("5.5"); | ||
}); | ||
|
||
it("identifies version from swift-driver version", async () => { | ||
const version = versionFromString( | ||
"swift-driver version: 1.26.9 Apple Swift version 5.5 (swiftlang-1300.0.31.1 clang-1300.0.29.1)" | ||
); | ||
expect(version).toBe("5.5"); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters