feat(boot): add -ROT <= >= gforth extensions
CI / check (push) Has been cancelled

Non-standard but ubiquitous words; absence aborted otherwise-valid
gforth programs with unknown-word errors.
This commit is contained in:
Oleksandr Kozachuk
2026-07-18 15:40:39 +02:00
parent d5acdc0e7b
commit 35b78193fd
2 changed files with 33 additions and 0 deletions
+20
View File
@@ -7462,6 +7462,12 @@ mod tests {
assert_eq!(eval_stack("1 2 3 ROT"), vec![1, 3, 2]);
}
#[test]
fn test_minus_rot() {
// ( 1 2 3 -- 3 1 2 ) top-first: [2, 1, 3]
assert_eq!(eval_stack("1 2 3 -ROT"), vec![2, 1, 3]);
}
// -- Comparison --
#[test]
@@ -7482,6 +7488,20 @@ mod tests {
assert_eq!(eval_stack("3 5 >"), vec![0]);
}
#[test]
fn test_less_or_equal() {
assert_eq!(eval_stack("3 5 <="), vec![-1]);
assert_eq!(eval_stack("5 5 <="), vec![-1]);
assert_eq!(eval_stack("5 3 <="), vec![0]);
}
#[test]
fn test_greater_or_equal() {
assert_eq!(eval_stack("5 3 >="), vec![-1]);
assert_eq!(eval_stack("5 5 >="), vec![-1]);
assert_eq!(eval_stack("3 5 >="), vec![0]);
}
// -- Logic --
#[test]