Link [ pkgsrc | NetBSD | pkgsrc git mirror | PR fulltext-search | netbsd commit viewer ]


   
        usage: [branch:branch] [user:user] [path[@revision]] keyword [... [-excludekeyword [...]]] (e.g. branch:MAIN pkgtools/pkg)




switch to index mode

recent branches: MAIN (3h)  pkgsrc-2024Q1 (8d)  pkgsrc-2023Q4 (55d)  pkgsrc-2023Q2 (88d)  pkgsrc-2023Q3 (167d) 

2024-05-26 10:11:28 UTC Now

2013-01-20 02:57:37 UTC MAIN commitmail json YAML

pkglint(1) determines its list of basic variable types by grepping
itself for certain if/elsif conditions. This combination of cleverness
and large conditional block should be replaced with simple,
table-driven code. But first we have to get the functionality under
test, which I've begun to do here.

Initialize a package global with the contents of $0, and override
it in test (otherwise self-grepping breaks because $0 is the test
script). Extract the dirty Test::Trap details to test_unit(). Test
main() for a few common values of @ARGV. Notice the aforementioned
cleverness because it broke an expected success, and fix it just
enough to test get_vartypes_basictypes() for a couple expected
types.

No functional change intended. I've manually tested the small changes
to pkglint.pl and have also verified that a couple packages lint
the same as before.

(schmonz)