-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
provide API to list supported language versions
- Loading branch information
1 parent
15c34a7
commit 0496613
Showing
9 changed files
with
78 additions
and
26 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,5 @@ | ||
--- | ||
"changelog": minor | ||
--- | ||
|
||
provide API to list supported language versions |
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
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
29 changes: 18 additions & 11 deletions
29
crates/solidity/outputs/cargo/crate/src/generated/language.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
mod cst_output; | ||
#[cfg(test)] | ||
mod errors; | ||
#[cfg(test)] | ||
mod versions; |
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,11 @@ | ||
use semver::Version; | ||
use slang_solidity::language::Language; | ||
|
||
#[test] | ||
fn list_supported_versions() { | ||
let versions = Language::supported_versions(); | ||
|
||
assert_eq!(false, versions.is_empty()); | ||
assert_eq!(false, versions.contains(&Version::parse("0.0.0").unwrap())); | ||
assert_eq!(true, versions.contains(&Version::parse("0.4.11").unwrap())); | ||
} |
27 changes: 16 additions & 11 deletions
27
crates/solidity/outputs/npm/crate/src/generated/language.rs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,10 @@ | ||
import test from "ava"; | ||
import { Language } from "@nomicfoundation/slang/language"; | ||
|
||
test("list supported versions", (t) => { | ||
const versions = Language.supportedVersions(); | ||
|
||
t.true(versions.length > 0); | ||
t.true(versions.includes("0.4.11")); | ||
t.false(versions.includes("0.0.0")); | ||
}); |