diff options
| author | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-04 15:11:01 (GMT) |
|---|---|---|
| committer | apnadkarni <apnmbx-wits@yahoo.com> | 2023-03-04 15:11:01 (GMT) |
| commit | c862e5709590a9330c9b814109a0fbfd70f027cb (patch) | |
| tree | 70b43a73aac6cd2c756bf315e7abee22f77ce22d | |
| parent | 0229ba1283c2457c63df5674f54831eeb4a120ca (diff) | |
| download | tcl-c862e5709590a9330c9b814109a0fbfd70f027cb.zip tcl-c862e5709590a9330c9b814109a0fbfd70f027cb.tar.gz tcl-c862e5709590a9330c9b814109a0fbfd70f027cb.tar.bz2 | |
Add test for [9c5a00c69d], tilde expansion of ~user
| -rw-r--r-- | tests/fileSystem.test | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/fileSystem.test b/tests/fileSystem.test index f363d86..2de778a 100644 --- a/tests/fileSystem.test +++ b/tests/fileSystem.test @@ -277,6 +277,16 @@ test filesystem-1.30.1 {normalisation of existing user} -body { test filesystem-1.30.2 {normalisation of nonexistent user specified as user@domain} -body { file normalize ~nonexistentuser@nonexistentdomain } -returnCodes error -result {user "nonexistentuser@nonexistentdomain" doesn't exist} +test filesystem-1.30.3 {file normalization should distinguish between ~ and ~user} -setup { + set oldhome $::env(HOME) + set olduserhome [file normalize ~$::tcl_platform(user)] + set ::env(HOME) [file join $oldhome temp] +} -cleanup { + set env(HOME) $oldhome +} -body { + list [string equal [file normalize ~] $::env(HOME)] \ + [string equal $olduserhome [file normalize ~$::tcl_platform(user)]] +} -result {1 1} test filesystem-1.31 {link normalisation: link near filesystem root} {testsetplatform} { testsetplatform unix file normalize /foo/../bar |
