<commit_before>;-*- Mode:     Lisp -*-
;;;; Author:   <NAME>
;;;; Created:  Sun Nov 17 12:37:45 2002
;;;; Contains: Tests of DO, DOING, RETURN in LOOP.  Tests of NAMED loops

(in-package :sicl-loop-test)

(deftest loop.13.1
  (loop do (return 10))
  10)

(deftest loop.13.2
  (loop doing (return 10))
  10)

(deftest loop.13.3
  (loop for i from 0 below 100 by 7
        when (> i 50) return i)
  56)

(deftest loop.13.4
  (let ((x 0))
    (loop do
          (incf x)
          (when (= x 10) (return x))))
  10)

(deftest loop.13.5
  (loop return 'a)
  a)

(deftest loop.13.6
  (loop return (values)))

(deftest loop.13.7
  (loop return (values 1 2))
  1 2)

(deftest loop.13.8
  (let* ((limit (min 1000 (1- (min call-arguments-limit
                                   multiple-values-limit))))
         (vals (make-list limit :initial-element :a))
         (vals2 (multiple-value-list (eval `(loop return (values ,@vals))))))
    (equal vals vals2))
  t)

;; (deftest loop.13.9
;;   (loop named foo return 'a)
;;   a)

;; (deftest loop.13.10
;;   (block nil<commit_msg>Added test for NAMED and RETURN.<commit_after>;-*- Mode:     Lisp -*-
;;;; Author:   <NAME>
;;;; Created:  Sun Nov 17 12:37:45 2002
;;;; Contains: Tests of DO, DOING, RETURN in LOOP.  Tests of NAMED loops

(in-package :sicl-loop-test)

(deftest loop.13.1
  (loop do (return 10))
  10)

(deftest loop.13.2
  (loop doing (return 10))
  10)

(deftest loop.13.3
  (loop for i from 0 below 100 by 7
        when (> i 50) return i)
  56)

(deftest loop.13.4
  (let ((x 0))
    (loop do
          (incf x)
          (when (= x 10) (return x))))
  10)

(deftest loop.13.5
  (loop return 'a)
  a)

(deftest loop.13.6
  (loop return (values)))

(deftest loop.13.7
  (loop return (values 1 2))
  1 2)

(deftest loop.13.8
  (let* ((limit (min 1000 (1- (min call-arguments-limit
                                   multiple-values-limit))))
         (vals (make-list limit :initial-element :a))
         (vals2 (multiple-value-list (eval `(loop return (values ,@vals))))))
    (equal vals vals2))
  t)

(deftest loop.13.9
  (loop named foo return 'a)
  a)

;; (deftest loop.13.10
;;   (block nil
{'fraction_non_alphanumeric': 0.1612453531598513, 'fraction_numerical': 0.07063197026022305, 'mean_word_length': 2.343167701863354, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6243048', 'n_tokens_mistral': 944, 'n_tokens_neox': 839, 'n_words': 262}