From: Kevin Ryde <user42@zip.com.au>
Subject: putenv tests (was: native Win32 guile 1.7.0)
Date: Sun, 15 Jun 2003 10:15:58 +1000 [thread overview]
Message-ID: <87llw4w5z5.fsf@zip.com.au> (raw)
In-Reply-To: Pine.LNX.4.44.0306120659140.436-100000@bono.reversers.net
[-- Attachment #1: Type: text/plain, Size: 273 bytes --]
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 :-).
[-- Attachment #2: posix.test --]
[-- Type: text/plain, Size: 2184 bytes --]
;;;; 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"))))
[-- Attachment #3: Type: text/plain, Size: 142 bytes --]
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2003-06-15 0:15 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-29 14:31 native Win32 guile 1.7.0 stefan
2003-05-29 23:13 ` Kevin Ryde
2003-05-29 23:23 ` Kevin Ryde
2003-05-30 3:23 ` stefan
2003-05-30 23:58 ` Kevin Ryde
2003-06-11 23:42 ` Kevin Ryde
2003-05-30 9:27 ` stefan
2003-05-31 0:20 ` Kevin Ryde
2003-06-08 22:03 ` Kevin Ryde
2003-06-11 23:15 ` Kevin Ryde
2003-06-12 5:01 ` stefan
2003-06-15 0:15 ` Kevin Ryde [this message]
2003-06-11 23:54 ` Kevin Ryde
2003-06-14 5:36 ` stefan
2003-06-14 12:24 ` Marius Vollmer
2003-06-14 13:46 ` stefan
2003-06-14 16:18 ` Marius Vollmer
2003-06-16 17:25 ` stefan
2003-06-18 23:42 ` Marius Vollmer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87llw4w5z5.fsf@zip.com.au \
--to=user42@zip.com.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).