Add support for XPM. (#3706)

* .xpm and .pm extensions associated with XPM.

* .pm is disambiguated by searching the /* XPM */ string.
  This is how `file` performs detection and should work with
  every XPM3 file (most XPM generated by software later than 1991).

Added XPM samples:

* stick-unfocus.xpm: extracted from Fluxbox (MIT License)
  0c13ddc0c8/data/styles/Emerge/pixmaps/stick-unfocus.xpm

* cc-public_domain_mark_white.pm: public domain image from
  https://commons.wikimedia.org/wiki/File:Cc-public_domain_mark_white.svg
  converted to XPM with ImageMagick (convert input.svg output.xpm).
This commit is contained in:
Santiago M. Mola
2017-07-22 15:19:22 +02:00
committed by Colin Seymour
parent e60384b018
commit 085604948e
6 changed files with 131 additions and 3 deletions

View File

@@ -221,11 +221,12 @@ class TestHeuristcs < Minitest::Test
})
end
# Candidate languages = ["Perl", "Perl 6"]
def test_pm_perl_by_heuristics
# Candidate languages = ["Perl", "Perl 6", "XPM"]
def test_pm_by_heuristics
assert_heuristics({
"Perl" => all_fixtures("Perl", "*.pm"),
"Perl 6" => all_fixtures("Perl 6", "*.pm")
"Perl 6" => all_fixtures("Perl 6", "*.pm"),
"XPM" => all_fixtures("XPM", "*.pm")
})
end