Skip to content

Commit

Permalink
updated kotlin test
Browse files Browse the repository at this point in the history
  • Loading branch information
asalvi0 committed Aug 26, 2024
1 parent 0de3e3a commit a46cd22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kotlin/binding_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ fun main(args: Array<String>) {
}
`

var output = `(source_file (import_list (import_header (identifier (simple_identifier) (simple_identifier) (simple_identifier)))) (function_declaration (simple_identifier) (function_value_parameters (parameter (simple_identifier) (user_type (type_identifier) (type_arguments (type_projection (user_type (type_identifier))))))) (function_body (statements (property_declaration (variable_declaration (simple_identifier)) (call_expression (navigation_expression (simple_identifier) (navigation_suffix (simple_identifier))) (call_suffix (value_arguments)))) (call_expression (simple_identifier) (call_suffix (value_arguments (value_argument (string_literal (interpolated_identifier))))))))))`
var output = `(source_file (import_list (import_header (identifier (simple_identifier) (simple_identifier) (simple_identifier)))) (function_declaration (simple_identifier) (function_value_parameters (parameter (simple_identifier) (user_type (type_identifier) (type_arguments (type_projection (user_type (type_identifier))))))) (function_body (statements (property_declaration (binding_pattern_kind) (variable_declaration (simple_identifier)) (call_expression (navigation_expression (simple_identifier) (navigation_suffix (simple_identifier))) (call_suffix (value_arguments)))) (call_expression (simple_identifier) (call_suffix (value_arguments (value_argument (string_literal (string_content) (interpolated_identifier))))))))))`

func TestGrammar(t *testing.T) {
n, err := sitter.ParseCtx(context.Background(), []byte(ktCode), kotlin.GetLanguage())
assert.Nil(t, err)
assert.Equal(t, n.String(), output)
assert.Equal(t, output, n.String())
}

0 comments on commit a46cd22

Please sign in to comment.