diff options
author | Prat T <pt2121@users.noreply.github.com> | 2020-05-03 12:09:49 -0700 |
---|---|---|
committer | Prat T <pt2121@users.noreply.github.com> | 2020-05-03 12:10:54 -0700 |
commit | 9e0ec4471ac62bb8982a1cc19cf61fc3189866ad (patch) | |
tree | f6f062332acbc0145b41437fda185e95a3b00244 /src/parse.rs | |
parent | df3ecd09d3e7897403c46c5f1042ce82a783f1c5 (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.rs | 12 |
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 |