Open ahakanbaba opened 6 years ago
Agreed, for all but expected-failures we should most probably have valid test files.
I have to use the usual phrase: pull requests are welcome.
We should put the command line for verifying the syntax to somewhere in our source tree. @ahakanbaba, could you write it to ~/var/ctags/Units/parser-puppetManifest.r/README ? This issue is parser-independent. So, we should provide a common tool and mechanism to verify the syntactical correctness of the test inputs. The tool must ignore "expected-failures" inputs. The temporary solution is just putting the README file.
Agreed, for all but expected-failures we should most probably have valid test files.
Thank for your comments @b4n . What do you mean exactly by "expected-failures"?
While creating this issue, I was under the impression that ctags unit tests should always use valid input language. But upon further thought, that may not be true. Thinking about the ctags use-cases, the user can run ctags anytime on any file. To give an example, even my puppetManifest file has a puppet syntax error, a ctags run on it should not get stuck at 100% cpu indefinitely. And ctags repo may have a test for that. That test would use a puppet file that is syntactically incorrect.
Given that requirement, not all test input files have to be syntactically correct in the original languages. But I do not know whether those type of tests reside in Units/* directory. (I am not familiar with ctags repo yet)
What are the "expected-failures" test cases inside the Units library ?
@ahakanbaba, what you wrote is correct. The Units directory holds both types of test inputs.
I didn't define the strict rule for distinguishing the types.
However, in the most of all cases, the following rule can be applied: if a .d
directory has an expected.tags file, associated input file should be syntactically correct.
While looking at the unit tests in
/ctags/Units/parser-puppetManifest.r
I have realized some of the *.pp files have errors in terms of puppet.The errors I have discovered are the following:
Maybe running an acceptance test on these unit test input files is the right thing to do. Overtime these files change via manual edits and we want to make sure they are still syntactically correct.
For puppet something like the following can be executed to verify correct syntax.