mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 17:50:22 +00:00
Test blank file
This commit is contained in:
@@ -308,7 +308,7 @@ module Linguist
|
||||
# Fail fast if blob isn't viewable?
|
||||
return unless viewable?
|
||||
|
||||
if data && (match = lines[0].match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
|
||||
if lines.any? && (match = lines[0].match(/(.+)\n?/)) && (bang = match[0]) =~ /^#!/
|
||||
bang.sub!(/^#! /, '#!')
|
||||
tokens = bang.split(' ')
|
||||
pieces = tokens.first.split('/')
|
||||
|
||||
0
test/fixtures/blank
vendored
Normal file
0
test/fixtures/blank
vendored
Normal file
@@ -240,6 +240,7 @@ class TestBlob < Test::Unit::TestCase
|
||||
assert_equal Language['VimL'], blob(".vimrc").language
|
||||
assert_equal Language['YAML'], blob(".gemrc").language
|
||||
|
||||
assert_nil blob("blank").language
|
||||
assert_nil blob("README").language
|
||||
|
||||
# https://github.com/xquery/xprocxq/blob/master/src/xquery/xproc.xqm
|
||||
|
||||
Reference in New Issue
Block a user