Skip to content

Commit

Permalink
test no default features
Browse files Browse the repository at this point in the history
  • Loading branch information
kaikalii committed Nov 2, 2023
1 parent a304b83 commit a030071
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
run: cargo build --verbose
- name: Run interpreter tests
run: cargo test --lib
- name: Run interpreter tests (no default)
run: cargo c --lib --no-default-features
- name: Run interpreter tests (audio)
run: cargo test --lib --features audio
- name: Run site tests
Expand Down
13 changes: 12 additions & 1 deletion src/primitive/defs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@ pub fn constants() -> &'static [ConstantDef] {

macro_rules! constant {
($(#[doc = $doc:literal] $(#[$attr:meta])* ($name:ident, $value:expr)),* $(,)?) => {
static CONSTANTS: Lazy<[ConstantDef; 0 $(+ { _ = stringify!($name) ; 1})*]> = Lazy::new(|| {
const COUNT: usize = {
let mut count = 0;
$(
$(#[$attr])*
{
_ = stringify!($name);
count += 1;
}
)*
count
};
static CONSTANTS: Lazy<[ConstantDef; COUNT]> = Lazy::new(|| {
[$(
$(#[$attr])*
ConstantDef {
Expand Down

0 comments on commit a030071

Please sign in to comment.