diff options
| -rw-r--r-- | src/util/language.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/util/language.rs b/src/util/language.rs index 8da45b8..f0870c8 100644 --- a/src/util/language.rs +++ b/src/util/language.rs @@ -63,4 +63,10 @@ mod tests { let contents = "#!/usr/bin/env sh\necho hi"; assert_eq!(detect_language(Path::new("file"), contents), "bash"); } + + #[test] + fn extension_overrides_shebang() { + let contents = "#!/bin/bash\nprint('hello')"; + assert_eq!(detect_language(Path::new("main.py"), contents), "python"); + } } |
