Skip to content

Commit

Permalink
Fix broken range test.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdaum committed Jul 23, 2023
1 parent 18cecc6 commit 9c278dd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions moor-lib/src/var/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -940,9 +940,9 @@ mod tests {
let string = v_str("hello world");
assert_eq!(string.range(2, 7)?, v_str("ello w"));

// test on empty list
// range with upper higher than lower, moo returns empty list for this (!)
let empty_list = v_list(vec![]);
assert_eq!(empty_list.range(1, 0), Ok(v_err(E_RANGE)));
assert_eq!(empty_list.range(1, 0), Ok(v_list(vec![])));
// test on out of range
let int_list = v_list(vec![1.into(), 2.into(), 3.into()]);
assert_eq!(int_list.range(2, 4), Ok(v_err(E_RANGE)));
Expand Down

0 comments on commit 9c278dd

Please sign in to comment.