()
| 53 | } |
| 54 | |
| 55 | @Test |
| 56 | public void test2() throws IOException { |
| 57 | String query = "A = load 'input' using PigStorage(';');" + |
| 58 | "B = foreach ^ A generate string.concatsep( ';', $1, $2 );"; |
| 59 | CharStream input = new QueryParserStringStream( query, null ); |
| 60 | QueryLexer lexer = new QueryLexer( input ); |
| 61 | Token token; |
| 62 | try { |
| 63 | while( ( token = lexer.nextToken() ).getType() != Token.EOF ) { |
| 64 | if( token.getChannel() == Token.HIDDEN_CHANNEL ) |
| 65 | continue; |
| 66 | if( token.getText().equals( ";" ) ) { |
| 67 | System.out.println( token.getText() ); |
| 68 | } else { |
| 69 | System.out.print( token.getText() + "(" + token.getType() + ") " ); |
| 70 | } |
| 71 | } |
| 72 | } catch(Exception ex) { |
| 73 | Assert.assertTrue( ex.getMessage().contains( "Unexpected character" ) ); |
| 74 | return; |
| 75 | } |
| 76 | Assert.fail( "Query should fail." ); |
| 77 | } |
| 78 | } |
nothing calls this directly
no test coverage detected