summaryrefslogtreecommitdiffstats
path: root/src/parse.rs
diff options
context:
space:
mode:
authorPrat T <pt2121@users.noreply.github.com>2020-05-03 12:09:49 -0700
committerPrat T <pt2121@users.noreply.github.com>2020-05-03 12:10:54 -0700
commit9e0ec4471ac62bb8982a1cc19cf61fc3189866ad (patch)
treef6f062332acbc0145b41437fda185e95a3b00244 /src/parse.rs
parentdf3ecd09d3e7897403c46c5f1042ce82a783f1c5 (diff)
Add test cases for a file with no extension.
Test get_file_extension_from_file_meta_line_file_path
Diffstat (limited to 'src/parse.rs')
-rw-r--r--src/parse.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/parse.rs b/src/parse.rs
index 48122d94..e1a08601 100644
--- a/src/parse.rs
+++ b/src/parse.rs
@@ -119,6 +119,18 @@ mod tests {
get_file_extension_from_file_meta_line_file_path("/dev/null"),
None
);
+ assert_eq!(
+ get_file_extension_from_file_meta_line_file_path("Makefile"),
+ Some("Makefile")
+ );
+ assert_eq!(
+ get_file_extension_from_file_meta_line_file_path("a/src/Makefile"),
+ Some("Makefile")
+ );
+ assert_eq!(
+ get_file_extension_from_file_meta_line_file_path("src/Makefile"),
+ Some("Makefile")
+ );
}
// We should only strip the prefixes if they are "a/" or "b/". This will be correct except for