diff options
Diffstat (limited to 'tests/snippets/kotlin')
8 files changed, 158 insertions, 0 deletions
diff --git a/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt b/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt new file mode 100644 index 0000000..8fc7f3d --- /dev/null +++ b/tests/snippets/kotlin/test_can_cope_generics_in_destructuring.txt @@ -0,0 +1,27 @@ +---input--- +val (a: List<Something>, b: Set<Wobble>) = + +---tokens--- +'val' Keyword.Declaration +' ' Text.Whitespace +'(' Punctuation +'a' Name.Variable +':' Punctuation +' ' Text.Whitespace +'List' Name +'<' Operator +'Something' Name +'>' Operator +',' Punctuation +' ' Text.Whitespace +'b' Name.Variable +':' Punctuation +' ' Text.Whitespace +'Set' Name +'<' Operator +'Wobble' Name +'>' Operator +')' Punctuation +' ' Text.Whitespace +'=' Operator +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt b/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt new file mode 100644 index 0000000..c89c0ef --- /dev/null +++ b/tests/snippets/kotlin/test_can_cope_with_backtick_names_in_functions.txt @@ -0,0 +1,8 @@ +---input--- +fun `wo bble` + +---tokens--- +'fun' Keyword.Declaration +' ' Text.Whitespace +'`wo bble`' Name.Function +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt b/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt new file mode 100644 index 0000000..7b2aed7 --- /dev/null +++ b/tests/snippets/kotlin/test_can_cope_with_commas_and_dashes_in_backtick_Names.txt @@ -0,0 +1,8 @@ +---input--- +fun `wo,-bble` + +---tokens--- +'fun' Keyword.Declaration +' ' Text.Whitespace +'`wo,-bble`' Name.Function +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_destructuring.txt b/tests/snippets/kotlin/test_can_cope_with_destructuring.txt new file mode 100644 index 0000000..3db6ed9 --- /dev/null +++ b/tests/snippets/kotlin/test_can_cope_with_destructuring.txt @@ -0,0 +1,16 @@ +---input--- +val (a, b) = + +---tokens--- +'val' Keyword.Declaration +' ' Text.Whitespace +'(' Punctuation +'a' Name.Variable +',' Punctuation +' ' Text.Whitespace +'b' Name.Variable +')' Punctuation +' ' Text.Whitespace +'=' Operator +' ' Text.Whitespace +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_can_cope_with_generics.txt b/tests/snippets/kotlin/test_can_cope_with_generics.txt new file mode 100644 index 0000000..09eb61f --- /dev/null +++ b/tests/snippets/kotlin/test_can_cope_with_generics.txt @@ -0,0 +1,34 @@ +---input--- +inline fun <reified T : ContractState> VaultService.queryBy(): Vault.Page<T> { + +---tokens--- +'inline' Keyword.Declaration +' ' Text.Whitespace +'fun' Keyword.Declaration +' ' Text.Whitespace +'<' Operator +'reified' Keyword +' ' Text.Whitespace +'T' Name +' ' Text.Whitespace +':' Punctuation +' ' Text.Whitespace +'ContractState' Name +'>' Operator +' ' Text.Whitespace +'VaultService' Name +'.' Punctuation +'queryBy' Name.Function +'(' Punctuation +')' Punctuation +':' Punctuation +' ' Text.Whitespace +'Vault' Name +'.' Punctuation +'Page' Name.Attribute +'<' Operator +'T' Name +'>' Operator +' ' Text.Whitespace +'{' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_modifier_keyword.txt b/tests/snippets/kotlin/test_modifier_keyword.txt new file mode 100644 index 0000000..730c0a5 --- /dev/null +++ b/tests/snippets/kotlin/test_modifier_keyword.txt @@ -0,0 +1,18 @@ +---input--- +data class A(val data: String) + +---tokens--- +'data' Keyword.Declaration +' ' Text.Whitespace +'class' Keyword.Declaration +' ' Text.Whitespace +'A' Name.Class +'(' Punctuation +'val' Keyword.Declaration +' ' Text.Whitespace +'data' Name.Variable +':' Punctuation +' ' Text.Whitespace +'String' Keyword.Type +')' Punctuation +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt b/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt new file mode 100644 index 0000000..33ec204 --- /dev/null +++ b/tests/snippets/kotlin/test_should_cope_with_multiline_comments.txt @@ -0,0 +1,12 @@ +---input--- +""" +this +is +a +comment""" + +---tokens--- +'"""' Literal.String +'\nthis\nis\na\ncomment' Literal.String +'"""' Literal.String +'\n' Text.Whitespace diff --git a/tests/snippets/kotlin/test_string_interpolation.txt b/tests/snippets/kotlin/test_string_interpolation.txt new file mode 100644 index 0000000..04ea254 --- /dev/null +++ b/tests/snippets/kotlin/test_string_interpolation.txt @@ -0,0 +1,35 @@ +---input--- +val something = "something" +"Here is $something" +"Here is ${something.toUpperList()}" + +---tokens--- +'val' Keyword.Declaration +' ' Text.Whitespace +'something' Name.Variable +' ' Text.Whitespace +'=' Operator +' ' Text.Whitespace +'"' Literal.String +'something' Literal.String +'"' Literal.String +'\n' Text.Whitespace + +'"' Literal.String +'Here is ' Literal.String +'$' Literal.String.Interpol +'something' Name +'"' Literal.String +'\n' Text.Whitespace + +'"' Literal.String +'Here is ' Literal.String +'${' Literal.String.Interpol +'something' Name +'.' Punctuation +'toUpperList' Name.Attribute +'(' Punctuation +')' Punctuation +'}' Literal.String.Interpol +'"' Literal.String +'\n' Text.Whitespace |