aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-06-24 13:37:09 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-06-24 13:37:09 -0400
commit271017ba9970e4220e1bd0dc83ce146afe9222a2 (patch)
tree995233d21141f164aa5f9e1d9b7bab757124e622 /test
parente122e5525ef044c25c2cd888bc267f7a2bd91b4f (diff)
Add Path.has_extension() and update manpages/api docs
Diffstat (limited to 'test')
-rw-r--r--test/paths.tm16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/paths.tm b/test/paths.tm
index 7685d089..14a15299 100644
--- a/test/paths.tm
+++ b/test/paths.tm
@@ -60,6 +60,22 @@ func main()
= "tar.gz"
>> p.extension(full=no)
= "gz"
+ >> p.has_extension("gz")
+ = yes
+ >> p.has_extension(".gz")
+ = yes
+ >> p.has_extension("tar.gz")
+ = yes
+ >> p.has_extension("txt")
+ = no
+ >> p.has_extension("")
+ = no
+ >> (./foo).has_extension("")
+ = yes
+ >> (..).has_extension("")
+ = yes
+ >> (~/.foo).has_extension("foo")
+ = no
>> (~/.foo).extension()
= ""
>> (~/foo).extension()