Reorganize tests into a real spec suite

This commit is contained in:
2024-08-04 19:18:43 -03:00
parent 57c160173c
commit e7c2053222
693 changed files with 136 additions and 116 deletions

View File

@ -0,0 +1,52 @@
---input---
# Regular file paths
@./some/path/to/a/file/foo.usda@
@/some/path/to/a/file/foo.usda@
@some/path/to/a/file/foo.usda@
@file://SPECI__Z-_ALIZED(syntax_here)?with_arbitrary#)(%*&)\characters.tar.gz@
# SdfPath syntax
</some/another_one/here>
</some/path/here.property_name>
</some/path/here>
<../some/another_one/here>
<../some/path/here.property_name>
<../some/path/here>
---tokens---
'# Regular file paths' Comment.Single
'\n\n' Text.Whitespace
'@./some/path/to/a/file/foo.usda@' Literal.String.Interpol
'\n' Text.Whitespace
'@/some/path/to/a/file/foo.usda@' Literal.String.Interpol
'\n' Text.Whitespace
'@some/path/to/a/file/foo.usda@' Literal.String.Interpol
'\n' Text.Whitespace
'@file://SPECI__Z-_ALIZED(syntax_here)?with_arbitrary#)(%*&)\\characters.tar.gz@' Literal.String.Interpol
'\n\n' Text.Whitespace
'# SdfPath syntax' Comment.Single
'\n' Text.Whitespace
'</some/another_one/here>' Name.Namespace
'\n' Text.Whitespace
'</some/path/here.property_name>' Name.Namespace
'\n' Text.Whitespace
'</some/path/here>' Name.Namespace
'\n' Text.Whitespace
'<../some/another_one/here>' Name.Namespace
'\n' Text.Whitespace
'<../some/path/here.property_name>' Name.Namespace
'\n' Text.Whitespace
'<../some/path/here>' Name.Namespace
'\n' Text.Whitespace

View File

@ -0,0 +1,174 @@
---input---
double foo = 8.0
custom double foo = 8.0
uniform double foo = 8.0
custom uniform double foo = 8.0
custom double foo_underscore_name = 8.0
double[] foo_underscore_name = [10.1, 12.0, 13]
double[] primvar:foo_thing = [10.1, 12.0, 13]
custom int[] foo = [8, 10, 14]
custom int[] foo.timeSamples = {
1: [8, 0, 14],
2: [-8, 0, 14],
}
---tokens---
'double' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'8.0' Literal.Number
'\n\n' Text.Whitespace
'custom' Keyword.Token
' ' Text.Whitespace
'double' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'8.0' Literal.Number
'\n\n' Text.Whitespace
'uniform' Keyword.Token
' ' Text.Whitespace
'double' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'8.0' Literal.Number
'\n\n' Text.Whitespace
'custom' Keyword.Token
' ' Text.Whitespace
'uniform' Keyword.Token
' ' Text.Whitespace
'double' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'8.0' Literal.Number
'\n\n' Text.Whitespace
'custom' Keyword.Token
' ' Text.Whitespace
'double' Keyword.Type
' ' Text.Whitespace
'foo_underscore_name' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'8.0' Literal.Number
'\n\n' Text.Whitespace
'double[]' Keyword.Type
' ' Text.Whitespace
'foo_underscore_name' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
'10.1' Literal.Number
',' Punctuation
' ' Text.Whitespace
'12.0' Literal.Number
',' Punctuation
' ' Text.Whitespace
'13' Literal.Number
']' Punctuation
'\n\n' Text.Whitespace
'double[]' Keyword.Type
' ' Text.Whitespace
'primvar:foo_thing' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
'10.1' Literal.Number
',' Punctuation
' ' Text.Whitespace
'12.0' Literal.Number
',' Punctuation
' ' Text.Whitespace
'13' Literal.Number
']' Punctuation
'\n\n' Text.Whitespace
'custom' Keyword.Token
' ' Text.Whitespace
'int[]' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
'8' Literal.Number
',' Punctuation
' ' Text.Whitespace
'10' Literal.Number
',' Punctuation
' ' Text.Whitespace
'14' Literal.Number
']' Punctuation
'\n\n' Text.Whitespace
'custom' Keyword.Token
' ' Text.Whitespace
'int[]' Keyword.Type
' ' Text.Whitespace
'foo' Name.Attribute
'.' Text
'timeSamples' Name.Keyword.Tokens
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'1' Literal.Number
':' Punctuation
' ' Text.Whitespace
'[' Punctuation
'8' Literal.Number
',' Punctuation
' ' Text.Whitespace
'0' Literal.Number
',' Punctuation
' ' Text.Whitespace
'14' Literal.Number
']' Punctuation
',' Punctuation
'\n ' Text.Whitespace
'2' Literal.Number
':' Punctuation
' ' Text.Whitespace
'[' Punctuation
'-8' Literal.Number
',' Punctuation
' ' Text.Whitespace
'0' Literal.Number
',' Punctuation
' ' Text.Whitespace
'14' Literal.Number
']' Punctuation
',' Punctuation
'\n' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace

View File

@ -0,0 +1,101 @@
---input---
def Xform "BottleMedical" (
kind = "prop"
payload = @./BottleMedical_payload.usd@</BottleMedical>
variants = {
string modelingVariant = "LiquidBottleLg"
string shadingComplexity = "full"
}
add variantSets = ["modelingVariant", "shadingComplexity"]
)
{
variantSet "modelingVariant" = {
"ALL_VARIANTS" {
}
}
}
---tokens---
'def' Keyword.Tokens
' ' Text.Whitespace
'Xform' Text
' ' Text.Whitespace
'"BottleMedical"' Literal.String
' ' Text.Whitespace
'(' Punctuation
'\n ' Text.Whitespace
'kind' Name.Builtins
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'"prop"' Literal.String
'\n ' Text.Whitespace
'payload' Keyword.Tokens
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'@./BottleMedical_payload.usd@' Literal.String.Interpol
'</BottleMedical>' Name.Namespace
'\n ' Text.Whitespace
'variants' Keyword.Tokens
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'string' Keyword.Type
' ' Text.Whitespace
'modelingVariant' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'"LiquidBottleLg"' Literal.String
'\n ' Text.Whitespace
'string' Keyword.Type
' ' Text.Whitespace
'shadingComplexity' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'"full"' Literal.String
'\n ' Text.Whitespace
'}' Punctuation
'\n ' Text.Whitespace
'add' Keyword.Type
' ' Text.Whitespace
'variantSets' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
'"modelingVariant"' Literal.String
',' Punctuation
' ' Text.Whitespace
'"shadingComplexity"' Literal.String
']' Punctuation
'\n' Text.Whitespace
')' Punctuation
'\n' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'variantSet' Keyword.Tokens
' ' Text.Whitespace
'"modelingVariant"' Literal.String
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'"ALL_VARIANTS"' Literal.String
' ' Text.Whitespace
'{' Punctuation
'\n ' Text.Whitespace
'}' Punctuation
'\n ' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace
'}' Punctuation
'\n' Text.Whitespace

View File

@ -0,0 +1,36 @@
# Make sure metadata [the stuff inside ()s] don't match as Attributes.
---input---
float[] primvars:skel:jointWeights = [1] (
elementSize = 1
interpolation = "constant"
)
---tokens---
'float[]' Keyword.Type
' ' Text.Whitespace
'primvars:skel:jointWeights' Name.Attribute
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'[' Punctuation
'1' Literal.Number
']' Punctuation
' ' Text.Whitespace
'(' Punctuation
'\n ' Text.Whitespace
'elementSize' Name.Builtins
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'1' Literal.Number
'\n ' Text.Whitespace
'interpolation' Name.Builtins
' ' Text.Whitespace
'=' Operator
' ' Text.Whitespace
'"constant"' Literal.String
'\n' Text.Whitespace
')' Punctuation
'\n' Text.Whitespace

View File

@ -0,0 +1,21 @@
---input---
8 8.0123312132, -4 -14.123 1e10 0.1e10 10.123e+10 0.123e-14
---tokens---
'8' Literal.Number
' ' Text.Whitespace
'8.0123312132' Literal.Number
',' Punctuation
' ' Text.Whitespace
'-4' Literal.Number
' ' Text.Whitespace
'-14.123' Literal.Number
' ' Text.Whitespace
'1e10' Literal.Number
' ' Text.Whitespace
'0.1e10' Literal.Number
' ' Text.Whitespace
'10.123e+10' Literal.Number
' ' Text.Whitespace
'0.123e-14' Literal.Number
'\n' Text.Whitespace

View File

@ -0,0 +1,14 @@
# Make sure that text between located between quotes and @@s are not matched.
---input---
@firststring@ something else @secondstring@
---tokens---
'@firststring@' Literal.String.Interpol
' ' Text.Whitespace
'something' Text
' ' Text.Whitespace
'else' Text
' ' Text.Whitespace
'@secondstring@' Literal.String.Interpol
'\n' Text.Whitespace

View File

@ -0,0 +1,12 @@
---input---
'firststring' something else 'secondstring'
---tokens---
"'firststring'" Literal.String
' ' Text.Whitespace
'something' Text
' ' Text.Whitespace
'else' Text
' ' Text.Whitespace
"'secondstring'" Literal.String
'\n' Text.Whitespace

View File

@ -0,0 +1,12 @@
---input---
'firststring' something else 'secondstring'
---tokens---
"'firststring'" Literal.String
' ' Text.Whitespace
'something' Text
' ' Text.Whitespace
'else' Text
' ' Text.Whitespace
"'secondstring'" Literal.String
'\n' Text.Whitespace

View File

@ -0,0 +1,20 @@
---input---
"""
Some text multiline
"""
"""Some text multiline
"""
"""
Some text multiline"""
---tokens---
'"""\nSome text multiline\n"""' Literal.String
'\n\n' Text.Whitespace
'"""Some text multiline\n"""' Literal.String
'\n\n' Text.Whitespace
'"""\nSome text multiline"""' Literal.String
'\n' Text.Whitespace

View File

@ -0,0 +1,10 @@
# Make sure that no other rules override a string match.
---input---
"""
custom int[] foo = [8, 10, 14]
"""
---tokens---
'"""\ncustom int[] foo = [8, 10, 14]\n"""' Literal.String
'\n' Text.Whitespace

View File

@ -0,0 +1,6 @@
---input---
"Some 'text"
---tokens---
'"Some \'text"' Literal.String
'\n' Text.Whitespace