user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* Re: [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile
  2021-06-22 12:09  7% [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile Alyssa Ross
@ 2021-06-22 18:56  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2021-06-22 18:56 UTC (permalink / raw)
  To: Alyssa Ross; +Cc: meta

Thanks, pushed as commit 2016078cefa7e4438217e54bb0421a5d5f0b151f

^ permalink raw reply	[relevance 7%]

* [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile
@ 2021-06-22 12:09  7% Alyssa Ross
  2021-06-22 18:56  7% ` Eric Wong
  0 siblings, 1 reply; 2+ results
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	[relevance 7%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-06-22 12:09  7% [PATCH] t/hl_mod: accept "make" or "makefile" for Makefile Alyssa Ross
2021-06-22 18:56  7% ` Eric Wong

Code repositories for project(s) associated with this public inbox

	https://80x24.org/public-inbox.git

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).