Thanks for working on it. Your test is checking that stuff in sample.conf is actually a GUC and not marked NOT_IN_SAMPLE. But those are both unlikely mistakes to make.
The important/interesting test is the opposite: that all GUCs are present in the sample file. It's a lot easier for someone to forget to add a GUC to sample.conf than it is for someone to accidentally add something that isn't a GUC. I'd first parse the GUC-like lines in the file, making a list of gucs_in_file and then compare the two lists. -- Justin