mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 11:50:28 +02:00
Add tests for memq' and
memv'.
This is a follow-up to a75ea65896
("fix
memq/memv inlining").
* test-suite/tests/list.test ("memq", "memv"): New test prefixes.
This commit is contained in:
parent
a75ea65896
commit
6debc49e2c
1 changed files with 18 additions and 1 deletions
|
@ -1,5 +1,5 @@
|
||||||
;;;; list.test --- tests guile's lists -*- scheme -*-
|
;;;; list.test --- tests guile's lists -*- scheme -*-
|
||||||
;;;; Copyright (C) 2000, 2001, 2006 Free Software Foundation, Inc.
|
;;;; Copyright (C) 2000, 2001, 2006, 2011 Free Software Foundation, Inc.
|
||||||
;;;;
|
;;;;
|
||||||
;;;; This library is free software; you can redistribute it and/or
|
;;;; This library is free software; you can redistribute it and/or
|
||||||
;;;; modify it under the terms of the GNU Lesser General Public
|
;;;; modify it under the terms of the GNU Lesser General Public
|
||||||
|
@ -658,9 +658,26 @@
|
||||||
|
|
||||||
;;; memq
|
;;; memq
|
||||||
|
|
||||||
|
(with-test-prefix/c&e "memq"
|
||||||
|
|
||||||
|
(pass-if "inline"
|
||||||
|
;; In this case `memq' is inlined and the loop is unrolled.
|
||||||
|
(equal? '(b c d) (memq 'b '(a b c d))))
|
||||||
|
|
||||||
|
(pass-if "non inline"
|
||||||
|
;; In this case a real function call is generated.
|
||||||
|
(equal? '(b c d) (memq 'b (list 'a 'b 'c 'd)))))
|
||||||
|
|
||||||
;;; memv
|
;;; memv
|
||||||
|
|
||||||
|
(with-test-prefix/c&e "memv"
|
||||||
|
(pass-if "inline"
|
||||||
|
;; In this case `memv' is inlined and the loop is unrolled.
|
||||||
|
(equal? '(b c d) (memv 'b '(a b c d))))
|
||||||
|
|
||||||
|
(pass-if "non inline"
|
||||||
|
;; In this case a real function call is generated.
|
||||||
|
(equal? '(b c d) (memv 'b (list 'a 'b 'c 'd)))))
|
||||||
|
|
||||||
;;; member
|
;;; member
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue