Feat: prelude and new words

This commit is contained in:
2026-02-05 00:58:53 +01:00
parent b75b9562af
commit 53fb3eb759
21 changed files with 533 additions and 29 deletions

View File

@@ -102,3 +102,43 @@ fn geom_zero_count() {
fn geom_underflow() {
expect_error("1 2 geom..", "stack underflow");
}
#[test]
fn step_range_ascending() {
expect_stack("0 1 0.25 .,", &[
int(0),
Value::Float(0.25, None),
Value::Float(0.5, None),
Value::Float(0.75, None),
int(1),
]);
}
#[test]
fn step_range_descending() {
expect_stack("1 0 -0.5 .,", &[
int(1),
Value::Float(0.5, None),
int(0),
]);
}
#[test]
fn step_range_integer_step() {
expect_stack("0 6 2 .,", &[int(0), int(2), int(4), int(6)]);
}
#[test]
fn step_range_single() {
expect_stack("5 5 1 .,", &[int(5)]);
}
#[test]
fn step_range_zero_step_error() {
expect_error("0 10 0 .,", "step cannot be zero");
}
#[test]
fn step_range_underflow() {
expect_error("0 1 .,", "stack underflow");
}