authorgravatar for yujiri@disroot.orgEvin Yulo <yujiri@disroot.org> 2022-09-21 22:55:38+00:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-09-22 20:13:09-04:00
logdab5bb9247b5e3454a221d62e3fe6f9580d5ab0b
treebc61de2fcf262602f8c70a03fe5a9f37d7e2771d
parent0e4b04672c000220ef47894086100610a9d6d9c3

Fix docstring for std.fs.path.extension


1 files changed, 4 insertions(+), 1 deletions(-)

lib/std/fs/path.zig+4-1
......@@ -1271,11 +1271,13 @@ fn testRelativeWindows(from: []const u8, to: []const u8, expected_output: []cons
12711271
12721272/// Returns the extension of the file name (if any).
12731273/// This function will search for the file extension (separated by a `.`) and will return the text after the `.`.
1274/// Files that end with `.` are considered to have no extension, files that start with `.`
1274/// Files that end with `.`, or that start with `.` and have no other `.` in their name,
1275/// are considered to have no extension.
12751276/// Examples:
12761277/// - `"main.zig"` ⇒ `".zig"`
12771278/// - `"src/main.zig"` ⇒ `".zig"`
12781279/// - `".gitignore"` ⇒ `""`
1280/// - `".image.png"` ⇒ `".png"`
12791281/// - `"keep."` ⇒ `"."`
12801282/// - `"src.keep.me"` ⇒ `".me"`
12811283/// - `"/src/keep.me"` ⇒ `".me"`
......@@ -1301,6 +1303,7 @@ test "extension" {
13011303 try testExtension(".a", "");
13021304 try testExtension(".file", "");
13031305 try testExtension(".gitignore", "");
1306 try testExtension(".image.png", ".png");
13041307 try testExtension("file.ext", ".ext");
13051308 try testExtension("file.ext.", ".");
13061309 try testExtension("very-long-file.bruh", ".bruh");