From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Kevin Ryde Newsgroups: gmane.lisp.guile.devel Subject: putenv tests (was: native Win32 guile 1.7.0) Date: Sun, 15 Jun 2003 10:15:58 +1000 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <87llw4w5z5.fsf@zip.com.au> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1055636170 15654 80.91.224.249 (15 Jun 2003 00:16:10 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 15 Jun 2003 00:16:10 +0000 (UTC) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sun Jun 15 02:16:06 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19RLBm-000442-00 for ; Sun, 15 Jun 2003 02:16:06 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19RLCl-0006d5-FC for guile-devel@m.gmane.org; Sat, 14 Jun 2003 20:17:07 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.20) id 19RLCB-0006Ub-Ii for guile-devel@gnu.org; Sat, 14 Jun 2003 20:16:31 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.20) id 19RLC2-0005yw-VS for guile-devel@gnu.org; Sat, 14 Jun 2003 20:16:26 -0400 Original-Received: from snoopy.pacific.net.au ([61.8.0.36]) by monty-python.gnu.org with esmtp (Exim 4.20) id 19RLC2-0005SQ-6h for guile-devel@gnu.org; Sat, 14 Jun 2003 20:16:22 -0400 Original-Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.2.228.40]) h5F0GEYd016654 for ; Sun, 15 Jun 2003 10:16:14 +1000 Original-Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id h5F0GEQg029035 for ; Sun, 15 Jun 2003 10:16:14 +1000 (EST) Original-Received: from localhost (ppp116.dyn228.pacific.net.au [203.143.228.116]) by wisma.pacific.net.au (8.12.9/8.12.9) with ESMTP id h5F0G7YZ013759 for ; Sun, 15 Jun 2003 10:16:10 +1000 (EST) Original-Received: from gg by localhost with local (Exim 3.35 #1 (Debian)) id 19RLBf-0000ut-00; Sun, 15 Jun 2003 10:15:59 +1000 Original-To: guile-devel@gnu.org Mail-Copies-To: never User-Agent: Gnus/5.090019 (Oort Gnus v0.19) Emacs/21.2 (gnu/linux) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2541 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2541 --=-=-= I think I'll add some small test cases for putenv and friends, * tests/posix.test: New file. * Makefile.am (SCM_TESTS): Add it. I don't want to gratuitously provoke failures, but the tests reflect the documentation and systems with problems need to be identified :-). --=-=-= Content-Disposition: attachment; filename=posix.test ;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*- ;;;; ;;;; Copyright 2003 Free Software Foundation, Inc. ;;;; ;;;; This program is free software; you can redistribute it and/or modify ;;;; it under the terms of the GNU General Public License as published by ;;;; the Free Software Foundation; either version 2, or (at your option) ;;;; any later version. ;;;; ;;;; This program is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;;; GNU General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU General Public License ;;;; along with this software; see the file COPYING. If not, write to ;;;; the Free Software Foundation, Inc., 59 Temple Place, Suite 330, ;;;; Boston, MA 02111-1307 USA (use-modules (test-suite lib)) ;; ;; putenv ;; (with-test-prefix "putenv" (pass-if "something" (putenv "FOO=something") (equal? "something" (getenv "FOO"))) (pass-if "replacing" (putenv "FOO=one") (putenv "FOO=two") (equal? "two" (getenv "FOO"))) (pass-if "empty" (putenv "FOO=") (equal? "" (getenv "FOO"))) (pass-if "removing" (putenv "FOO=bar") (putenv "FOO") (not (getenv "FOO"))) (pass-if "modifying string doesn't change env" (let ((s (string-copy "FOO=bar"))) (putenv s) (string-set! s 5 #\x) (equal? "bar" (getenv "FOO"))))) ;; ;; setenv ;; (with-test-prefix "setenv" (pass-if "something" (setenv "FOO" "something") (equal? "something" (getenv "FOO"))) (pass-if "replacing" (setenv "FOO" "one") (setenv "FOO" "two") (equal? "two" (getenv "FOO"))) (pass-if "empty" (setenv "FOO" "") (equal? "" (getenv "FOO"))) (pass-if "removing" (setenv "FOO" "something") (setenv "FOO" #f) (not (getenv "FOO")))) ;; ;; unsetenv ;; (with-test-prefix "unsetenv" (pass-if "something" (putenv "FOO=something") (unsetenv "FOO") (not (getenv "FOO"))) (pass-if "empty" (putenv "FOO=") (unsetenv "FOO") (not (getenv "FOO")))) --=-=-= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel --=-=-=--