Skip to content
Snippets Groups Projects
lexer_test.go 343 B
Newer Older
  • Learn to ignore specific revisions
  • package gqlex
    
    import (
    	"fmt"
    	"testing"
    )
    
    func TestNewLexer(t *testing.T) {
    	input := `
    
    Manish R Jain's avatar
    Manish R Jain committed
    		me( id: 10, xid: rick ) {
    
    			name0 # my name
    			_city, # 0what would fail lex.
    
    Manish R Jain's avatar
    Manish R Jain committed
    			profilePic(width: 100, height: 100)
    
    			friends {
    				name
    			}
    		}
    	}`
    	l := newLexer(input)
    	for item := range l.items {
    		fmt.Println(item.String())
    	}
    }