From 271017ba9970e4220e1bd0dc83ce146afe9222a2 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 24 Jun 2025 13:37:09 -0400 Subject: Add Path.has_extension() and update manpages/api docs --- test/paths.tm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'test') 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() -- cgit v1.2.3