fix: incorrect arg counting for modulo
This commit is contained in:
parent
26ba457e8e
commit
040a2518cc
2 changed files with 7 additions and 4 deletions
|
@ -7,10 +7,12 @@ macro_rules! arg_count {
|
|||
};
|
||||
|
||||
(modulo: $modulo:expr, $given:expr) => {
|
||||
Err(Error::MismatchedArgCount(
|
||||
($given / $modulo) * $modulo + $modulo,
|
||||
$given,
|
||||
))?
|
||||
if $given % $modulo != 0 {
|
||||
Err(Error::MismatchedArgCount(
|
||||
($given / $modulo) * $modulo + $modulo,
|
||||
$given,
|
||||
))?
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -254,6 +254,7 @@ mod test {
|
|||
#[rstest]
|
||||
#[case("{:a}")]
|
||||
#[case("(not-a-func :uwu)")]
|
||||
#[case("{:a}")]
|
||||
fn test_evaluator_fail(#[case] input: &str) {
|
||||
let env = core_environment();
|
||||
let tokens = lexer::read(input).unwrap();
|
||||
|
|
Loading…
Reference in a new issue