@Test public void testChannelDefinitionInLexer() throws Exception {
		String grammar =
			"lexer grammar T;\n" +
			"\n" +
			"channels {\n" +
			"	WHITESPACE_CHANNEL,\n" +
			"	COMMENT_CHANNEL\n" +
			"}\n" +
			"\n" +
			"COMMENT:    '//' ~[\\n]+ -> channel(COMMENT_CHANNEL);\n" +
			"WHITESPACE: [ \\t]+      -> channel(WHITESPACE_CHANNEL);\n";

		String expected = "";

		String[] pair = { grammar, expected };
		testErrors(pair, true);
	}
This is a regression test for antlr/antlr4#649 "unknown target causes
null ptr exception.".
https://github.com/antlr/antlr4/issues/649
tool-testsuite/test/org/antlr/v4/test/tool/TestToolSyntaxErrors.java