summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-06-04 21:20:15 +0200
committerLudovic Courtès <ludo@gnu.org>2019-06-04 21:24:02 +0200
commit36ad1d24b3d2c174a64c445502a36f19605dbd65 (patch)
treeab03139bea21a023610042fa6875b3836943706d /test-suite
parent65d98d8fd290f985e49994f784b02b8e5ce01dd6 (diff)
'basename' correctly handles "/" and "//".
* libguile/filesys.c (scm_basename): Special-case "/" and "//". * test-suite/tests/filesys.test ("basename"): New test prefix.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/tests/filesys.test8
1 files changed, 7 insertions, 1 deletions
diff --git a/test-suite/tests/filesys.test b/test-suite/tests/filesys.test
index fceb182be..9ec9f6172 100644
--- a/test-suite/tests/filesys.test
+++ b/test-suite/tests/filesys.test
@@ -1,6 +1,6 @@
;;;; filesys.test --- test file system functions -*- scheme -*-
;;;;
-;;;; Copyright (C) 2004, 2006, 2013 Free Software Foundation, Inc.
+;;;; Copyright (C) 2004, 2006, 2013, 2019 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
@@ -222,6 +222,12 @@
(cons (join-thread child) out)))
(throw 'unresolved)))))
+(with-test-prefix "basename"
+
+ (pass-if-equal "/" "/" (basename "/"))
+ (pass-if-equal "//" "/" (basename "//"))
+ (pass-if-equal "a/b/c" "c" (basename "a/b/c")))
+
(delete-file (test-file))
(when (file-exists? (test-symlink))
(delete-file (test-symlink)))