<commit_before>;-*- Mode:     Lisp -*-
;;;; Author:   <NAME>
;;;; Created:  Thu Nov 14 06:25:21 2002
;;;; Contains: Tests for loop list accumulation clauses

(in-package :sicl-loop-test)

;;; Tests of COLLECT, COLLECTING

(deftest loop.9.1
  (loop for x in '(2 3 4) collect (1+ x))
  (3 4 5))

(deftest loop.9.2
  (loop for x in '(2 3 4) collecting (1+ x))
  (3 4 5))

;; (deftest loop.9.3
;;   (loop for x in '(0 1 2)
;;         when (eql x 2) do (return 'good)
;;         collect x)
;;   good)

;; (deftest loop.9.4
;;   (loop for x in '(a b c)
;;         collect (list x) into foo
;;         finally (return (reverse foo)))
;;   ((c) (b) (a)))

;; (deftest loop.9.5
;;   (loop for x in '(a b c)
;;         collecting (list x) into foo
;;         finally (return (reverse foo)))
;;   ((c) (b) (a)))
<commit_msg>Added test for COLLECT with intervening RETURN clause.<commit_after>;-*- Mode:     Lisp -*-
;;;; Author:   <NAME>
;;;; Created:  Thu Nov 14 06:25:21 2002
;;;; Contains: Tests for loop list accumulation clauses

(in-package :sicl-loop-test)

;;; Tests of COLLECT, COLLECTING

(deftest loop.9.1
  (loop for x in '(2 3 4) collect (1+ x))
  (3 4 5))

(deftest loop.9.2
  (loop for x in '(2 3 4) collecting (1+ x))
  (3 4 5))

(deftest loop.9.3
  (loop for x in '(0 1 2)
        when (eql x 2) do (return 'good)
        collect x)
  good)

;; (deftest loop.9.4
;;   (loop for x in '(a b c)
;;         collect (list x) into foo
;;         finally (return (reverse foo)))
;;   ((c) (b) (a)))

;; (deftest loop.9.5
;;   (loop for x in '(a b c)
;;         collecting (list x) into foo
;;         finally (return (reverse foo)))
;;   ((c) (b) (a)))

{'fraction_non_alphanumeric': 0.18583535108958837, 'fraction_numerical': 0.048426150121065374, 'mean_word_length': 2.5021186440677967, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5291877', 'n_tokens_mistral': 698, 'n_tokens_neox': 648, 'n_words': 237}