unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
* [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile
@ 2021-06-22 12:09 Alyssa Ross
  2021-06-22 18:56 ` Eric Wong
  0 siblings, 1 reply; 2+ messages in thread
From: Alyssa Ross @ 2021-06-22 12:09 UTC (permalink / raw)
  To: meta; +Cc: Alyssa Ross

Version 4.0 of highlight has renamed the "make" language to
"makefile".  So just check the string starts with "make", to handle
both 3.x and 4.x.

I tested that public-inbox does actually work with highlight 4 -- it
can highlight my Makefile fine. :)
---
 t/hl_mod.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/hl_mod.t b/t/hl_mod.t
index 95057354..e28f26b5 100644
--- a/t/hl_mod.t
+++ b/t/hl_mod.t
@@ -16,7 +16,7 @@ ok($hls, 'initialized OK');
 is($hls->_shebang2lang(\"#!/usr/bin/perl -w\n"), 'perl', 'perl shebang OK');
 is($hls->{-ext2lang}->{'pm'}, 'perl', '.pm suffix OK');
 is($hls->{-ext2lang}->{'pl'}, 'perl', '.pl suffix OK');
-is($hls->_path2lang('Makefile'), 'make', 'Makefile OK');
+like($hls->_path2lang('Makefile'), qr/\Amake/, 'Makefile OK');
 my $str = do { local $/; open(my $fh, __FILE__); <$fh> };
 my $orig = $str;
 
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile
  2021-06-22 12:09 [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile Alyssa Ross
@ 2021-06-22 18:56 ` Eric Wong
  0 siblings, 0 replies; 2+ messages in thread
From: Eric Wong @ 2021-06-22 18:56 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: meta

Thanks, pushed as commit 2016078cefa7e4438217e54bb0421a5d5f0b151f

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-22 18:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 12:09 [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile Alyssa Ross
2021-06-22 18:56 ` Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).