[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 16/55: Add tests for type inferencing for 'nil?' and 'nu
From: |
Andy Wingo |
Subject: |
[Guile-commits] 16/55: Add tests for type inferencing for 'nil?' and 'null?' predicates. |
Date: |
Thu, 23 May 2019 11:52:39 -0400 (EDT) |
wingo pushed a commit to branch master
in repository guile.
commit 0e750990dd222d861dd2da16f601aad59ef33795
Author: Mark H Weaver <address@hidden>
Date: Sat Oct 13 23:02:05 2018 -0400
Add tests for type inferencing for 'nil?' and 'null?' predicates.
These tests come from a fix for <https://bugs.gnu.org/33036>, which was
fixed already in the 2.9.x branch.
* test-suite/tests/compiler.test: Add tests.
---
test-suite/tests/compiler.test | 51 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 50 insertions(+), 1 deletion(-)
diff --git a/test-suite/tests/compiler.test b/test-suite/tests/compiler.test
index 4f644f3..64bb976 100644
--- a/test-suite/tests/compiler.test
+++ b/test-suite/tests/compiler.test
@@ -1,5 +1,5 @@
;;;; compiler.test --- tests for the compiler -*- scheme -*-
-;;;; Copyright (C) 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software
Foundation, Inc.
+;;;; Copyright (C) 2008-2014, 2018 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -251,3 +251,52 @@
(pass-if-equal "test flonum" 0.0 (test-proc #t))
(pass-if-equal "test complex" 0.0+0.0i (test-proc #f)))
+
+(with-test-prefix "null? and nil? inference"
+ (pass-if-equal "nil? after null?"
+ '((f . f) ; 3
+ (f . f) ; #t
+ (f . t) ; #f
+ (t . t) ; #nil
+ (t . t)) ; ()
+ (map (compile '(lambda (x)
+ (if (null? x)
+ (cons 't (if (nil? x) 't 'f))
+ (cons 'f (if (nil? x) 't 'f)))))
+ '(3 #t #f #nil ())))
+
+ (pass-if-equal "nil? after truth test"
+ '((t . f) ; 3
+ (t . f) ; #t
+ (f . t) ; #f
+ (f . t) ; #nil
+ (t . t)) ; ()
+ (map (compile '(lambda (x)
+ (if x
+ (cons 't (if (nil? x) 't 'f))
+ (cons 'f (if (nil? x) 't 'f)))))
+ '(3 #t #f #nil ())))
+
+ (pass-if-equal "null? after nil?"
+ '((f . f) ; 3
+ (f . f) ; #t
+ (t . f) ; #f
+ (t . t) ; #nil
+ (t . t)) ; ()
+ (map (compile '(lambda (x)
+ (if (nil? x)
+ (cons 't (if (null? x) 't 'f))
+ (cons 'f (if (null? x) 't 'f)))))
+ '(3 #t #f #nil ())))
+
+ (pass-if-equal "truth test after nil?"
+ '((f . t) ; 3
+ (f . t) ; #t
+ (t . f) ; #f
+ (t . f) ; #nil
+ (t . t)) ; ()
+ (map (compile '(lambda (x)
+ (if (nil? x)
+ (cons 't (if x 't 'f))
+ (cons 'f (if x 't 'f)))))
+ '(3 #t #f #nil ()))))
- [Guile-commits] 01/55: time: Use 'syntax-rules' instead of 'define-macro'., (continued)
- [Guile-commits] 01/55: time: Use 'syntax-rules' instead of 'define-macro'., Andy Wingo, 2019/05/23
- [Guile-commits] 03/55: time: Use #: for 'define-module' clauses., Andy Wingo, 2019/05/23
- [Guile-commits] 02/55: time: Support expressions that return any number of values., Andy Wingo, 2019/05/23
- [Guile-commits] 06/55: Fix 32/64 bit bug in INTEGER_ACCESSOR_PROLOGUE, Andy Wingo, 2019/05/23
- [Guile-commits] 10/55: Fix 'round-ash' of negative integers by huge right shift counts., Andy Wingo, 2019/05/23
- [Guile-commits] 12/55: Clarify the manual's "Processes" section., Andy Wingo, 2019/05/23
- [Guile-commits] 09/55: Gracefully handle huge shift counts in 'ash' and 'round-ash'., Andy Wingo, 2019/05/23
- [Guile-commits] 24/55: SRFI-19: time-utc->date: Support non-integer nanoseconds values., Andy Wingo, 2019/05/23
- [Guile-commits] 21/55: SRFI-19: Add a few more tests., Andy Wingo, 2019/05/23
- [Guile-commits] 11/55: In 'ash' and 'round-ash', handle right shift count of LONG_MIN., Andy Wingo, 2019/05/23
- [Guile-commits] 16/55: Add tests for type inferencing for 'nil?' and 'null?' predicates.,
Andy Wingo <=
- [Guile-commits] 22/55: SRFI-19: Fix normalization of seconds and nanoseconds in time records., Andy Wingo, 2019/05/23
- [Guile-commits] 20/55: SRFI-19: Fix handling of negative years and negative julian days., Andy Wingo, 2019/05/23
- [Guile-commits] 37/55: Avoid leaking a file descriptor in test-unwind, Andy Wingo, 2019/05/23
- [Guile-commits] 38/55: Fix binary output on files created by mkstemp!, Andy Wingo, 2019/05/23
- [Guile-commits] 43/55: Fix typo in comment., Andy Wingo, 2019/05/23
- [Guile-commits] 04/55: Define AT_SYMLINK_NOFOLLOW et al., Andy Wingo, 2019/05/23
- [Guile-commits] 08/55: Fix list validation of *list->bytevector procedures., Andy Wingo, 2019/05/23
- [Guile-commits] 13/55: Update SRFI-19 leap second table., Andy Wingo, 2019/05/23
- [Guile-commits] 05/55: Fix 'atomic-box-compare-and-swap!'., Andy Wingo, 2019/05/23
- [Guile-commits] 26/55: Add texinfo dependency to README, Andy Wingo, 2019/05/23