Skip to content

Commit

Permalink
fix: move tests to top level test dir
Browse files Browse the repository at this point in the history
  • Loading branch information
amaanq committed May 4, 2024
1 parent 39d2e96 commit 71b4a9e
Show file tree
Hide file tree
Showing 21 changed files with 487 additions and 290 deletions.
1 change: 0 additions & 1 deletion php/test/corpus/common

This file was deleted.

1 change: 0 additions & 1 deletion php/test/highlight

This file was deleted.

1 change: 0 additions & 1 deletion php_only/test/corpus/common

This file was deleted.

1 change: 0 additions & 1 deletion php_only/test/highlight

This file was deleted.

2 changes: 1 addition & 1 deletion queries/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
; Basic tokens
[
(string)
(string_value)
(string_content)
(encapsed_string)
(heredoc)
(heredoc_body)
Expand Down
24 changes: 12 additions & 12 deletions common/test/corpus/bugs.txt → test/corpus/bugs.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=========================================
#131: Parse error when using self as constant
Parse error when using self as constant
=========================================

<?php
Expand All @@ -14,15 +14,15 @@ var_dump(self);
(function_call_expression
function: (name)
arguments: (arguments
(argument (string (string_value)))
(argument (string (string_value))))))
(argument (string (string_content)))
(argument (string (string_content))))))
(expression_statement
(function_call_expression
function: (name)
arguments: (arguments (argument (name))))))

=========================================
#133: Incorrect precedence for error suppression operator
Incorrect precedence for error suppression operator
=========================================

<?php
Expand All @@ -40,16 +40,16 @@ var_dump(self);
arguments: (arguments
(argument
(encapsed_string
(string_value))))))
(string_content))))))
right: (function_call_expression
function: (name)
arguments: (arguments
(argument
(encapsed_string
(string_value))))))))
(string_content))))))))

=========================================
#161: Error when using expressions as named argument
Error when using expressions as named argument
=========================================

<?php
Expand Down Expand Up @@ -165,7 +165,7 @@ foo(void: null);
arguments: (arguments (argument name: (name) (null))))))

=========================================
#221: Error when closing tag is in a string
Error when closing tag is in a string
=========================================

<?php
Expand All @@ -185,15 +185,15 @@ $foo = '?>';
(expression_statement
(assignment_expression
left: (variable_name (name))
right: (encapsed_string (string_value))))
right: (encapsed_string (string_content))))
(expression_statement
(assignment_expression
left: (variable_name
(name))
right: (heredoc
identifier: (heredoc_start)
value: (heredoc_body
(string_value))
(string_content))
end_tag: (heredoc_end))))
(expression_statement
(assignment_expression
Expand All @@ -207,10 +207,10 @@ $foo = '?>';
(expression_statement
(assignment_expression
left: (variable_name (name))
right: (string (string_value)))))
right: (string (string_content)))))

=========================================
#223: Error with comment inside binary expression
Error with comment inside binary expression
=========================================

<?php
Expand Down
2 changes: 1 addition & 1 deletion common/test/corpus/class.txt → test/corpus/class.txt
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class A {
(base_clause (name))
(declaration_list
(const_declaration
(const_element (name) (string (string_value)))
(const_element (name) (string (string_content)))
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Exception_foo implements ThrowableInterface {
body: (declaration_list
(property_declaration
(visibility_modifier)
(property_element (variable_name (name)) (property_initializer (encapsed_string (string_value)))))
(property_element (variable_name (name)) (property_initializer (encapsed_string (string_content)))))
(method_declaration
(visibility_modifier)
name: (name)
Expand Down Expand Up @@ -141,23 +141,23 @@ class foo {
name: (variable_name (name))))
body: (compound_statement
(expression_statement (reference_assignment_expression
left: (subscript_expression (variable_name (name)) (string (string_value)))
left: (subscript_expression (variable_name (name)) (string (string_content)))
right: (variable_name (name))))
(expression_statement (assignment_expression
left: (member_access_expression
object: (variable_name (name))
name: (name))
right: (variable_name (name))))
(expression_statement (member_call_expression
object: (subscript_expression (variable_name (name)) (string (string_value)))
object: (subscript_expression (variable_name (name)) (string (string_content)))
name: (name)
arguments: (arguments)))))
(method_declaration
name: (name)
parameters: (formal_parameters)
body: (compound_statement
(expression_statement (assignment_expression
left: (subscript_expression (subscript_expression (variable_name (name)) (string (string_value))))
left: (subscript_expression (subscript_expression (variable_name (name)) (string (string_content))))
right: (member_access_expression
object: (variable_name (name))
name: (name)))))))))
Expand Down Expand Up @@ -271,46 +271,46 @@ define('ANIMALS', array(
(function_call_expression
(name)
(arguments
(argument (encapsed_string (string_value)))
(argument (encapsed_string (string_value)))
(argument (encapsed_string (string_content)))
(argument (encapsed_string (string_content)))
)
)
)
(const_declaration
(const_element
(name)
(string (string_value))
(string (string_content))
)
)
(const_declaration
(const_element
(name)
(binary_expression
(name)
(string (string_value))
(string (string_content))
)
)
)
(const_declaration
(const_element
(name)
(array_creation_expression
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_content)))
(array_element_initializer (string (string_content)))
(array_element_initializer (string (string_content)))
)
)
)
(expression_statement
(function_call_expression
(name)
(arguments
(argument (string (string_value)))
(argument (string (string_content)))
(argument
(array_creation_expression
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_value)))
(array_element_initializer (string (string_content)))
(array_element_initializer (string (string_content)))
(array_element_initializer (string (string_content)))
)
)
)
Expand Down Expand Up @@ -405,7 +405,7 @@ class B {
body: (declaration_list
(const_declaration
attributes: (attribute_list (attribute_group (attribute (name))))
(const_element (name) (string (string_value)))
(const_element (name) (string (string_content)))
)

(property_declaration
Expand All @@ -422,10 +422,10 @@ class B {
(attribute
(name)
parameters: (arguments
(argument (encapsed_string (string_value)))
(argument (encapsed_string (string_content)))
(argument
(array_creation_expression
(array_element_initializer (encapsed_string (string_value)))
(array_element_initializer (encapsed_string (string_content)))
)
)
)
Expand Down Expand Up @@ -485,8 +485,8 @@ class B {
(argument
(array_creation_expression
(array_element_initializer
(encapsed_string (string_value))
(encapsed_string (string_value))
(encapsed_string (string_content))
(encapsed_string (string_content))
)
)
)
Expand Down Expand Up @@ -690,10 +690,10 @@ enum Suit: string
(name)
(primitive_type)
(enum_declaration_list
(enum_case (name) (string (string_value)))
(enum_case (name) (string (string_content)))
(enum_case (name))
(enum_case (name) (encapsed_string (string_value)))
(enum_case (name) (heredoc (heredoc_start) (heredoc_body (string_value)) (heredoc_end)))
(enum_case (name) (encapsed_string (string_content)))
(enum_case (name) (heredoc (heredoc_start) (heredoc_body (string_content)) (heredoc_end)))
(comment)
(method_declaration
(visibility_modifier)
Expand All @@ -712,14 +712,14 @@ enum Suit: string
(class_constant_access_expression (name) (name))
(class_constant_access_expression (name) (name))
)
(string (string_value))
(string (string_content))
)
(match_conditional_expression
(match_condition_list
(class_constant_access_expression (name) (name))
(class_constant_access_expression (name) (name))
)
(string (string_value))
(string (string_content))
)
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Quotes in backticks
(php_tag)
(expression_statement
(shell_command_expression
(string_value))))
(string_content))))

================================================================================
Escape sequences in backticks
Expand All @@ -27,9 +27,9 @@ Escape sequences in backticks
(php_tag)
(expression_statement
(shell_command_expression
(string_value)
(string_content)
(escape_sequence)
(string_value)))
(string_content)))
(expression_statement
(shell_command_expression
(escape_sequence)
Expand All @@ -51,7 +51,7 @@ $cmd = 'ls';
(assignment_expression
(variable_name
(name))
(string (string_value))))
(string (string_content))))
(expression_statement
(shell_command_expression
(variable_name
Expand Down Expand Up @@ -83,7 +83,7 @@ $obj->cmd = 'ls';
(variable_name
(name))
(name))
(string (string_value))))
(string (string_content))))
(expression_statement
(shell_command_expression
(member_access_expression
Expand All @@ -109,7 +109,7 @@ $cmd = array('ls');
(name))
(array_creation_expression
(array_element_initializer
(string (string_value))))))
(string (string_content))))))
(expression_statement
(shell_command_expression
(subscript_expression
Expand All @@ -133,7 +133,7 @@ $cmd = 'ls';
(assignment_expression
(variable_name
(name))
(string (string_value))))
(string (string_content))))
(expression_statement
(shell_command_expression
(variable_name
Expand All @@ -153,9 +153,9 @@ Nesting of expression in backticks
(expression_statement
(binary_expression
(shell_command_expression
(string_value))
(string_content))
(shell_command_expression
(string_value)))))
(string_content)))))

================================================================================
Nested escaped backticks
Expand All @@ -171,7 +171,7 @@ Nested escaped backticks
(expression_statement
(shell_command_expression
(escape_sequence)
(string_value)
(string_content)
(escape_sequence))))

================================================================================
Expand All @@ -187,4 +187,4 @@ Comment in backticks
(php_tag)
(expression_statement
(shell_command_expression
(string_value))))
(string_content))))
Loading

0 comments on commit 71b4a9e

Please sign in to comment.