From 05af4419f95d3c5fe89f7fbe643d07c1e9602e86 Mon Sep 17 00:00:00 2001 From: Karsten Poeck Date: Sun, 10 May 2020 09:40:19 +0200 Subject: [PATCH] Test for positive -by-, see issue 300 --- ansi-tests/loop1.lsp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ansi-tests/loop1.lsp b/ansi-tests/loop1.lsp index 8cd6355e..e567f7c4 100644 --- a/ansi-tests/loop1.lsp +++ b/ansi-tests/loop1.lsp @@ -358,4 +358,17 @@ (loop for i from 1 below (expand-in-current-env (%m 5)) collect i)) (1 2 3 4)) - +;;; http://www.lispworks.com/documentation/lw51/CLHS/Body/06_abaa.htm +;;; by The loop keyword by marks the increment or decrement supplied by form3. +;;; The value of form3 can be any positive number. The default value is 1. +(deftest loop.1.66 + (signals-error + (loop for i below 10 for j by 0 collect (list i j)) + program-error) + t) + +(deftest loop.1.67 + (signals-error + (loop for i below 10 for j by -1 collect (list i j)) + program-error) + t)