mirror of
https://github.com/ralsina/tartrazine.git
synced 2025-06-19 06:33:06 -03:00
Reorganize tests into a real spec suite
This commit is contained in:
155
spec/tests/terraform/test_attributes.txt
Normal file
155
spec/tests/terraform/test_attributes.txt
Normal file
@ -0,0 +1,155 @@
|
||||
---input---
|
||||
description = "Some description"
|
||||
|
||||
availability_zones = ["${aws_instance.web.availability_zone}-foobar"]
|
||||
availability_zones = [aws_instance.web.availability_zone]
|
||||
assume_role_policy = data.aws_iam_policy_document.trust.json
|
||||
policy_arn = aws_iam_policy.assume_roles[0].arn
|
||||
|
||||
value = file("path.txt")
|
||||
value = jsonencode(element("value"))
|
||||
|
||||
tags = {
|
||||
Name = "something"
|
||||
}
|
||||
|
||||
"ENV_VARIABLE_1" = aws_dynamodb_table.loginsights2metrics.name
|
||||
"ENV_VARIABLE_2" = "Some string"
|
||||
|
||||
ignore_changes = [last_modified, filename]
|
||||
|
||||
variable = "aws:MultiFactorAuthPresent"
|
||||
|
||||
---tokens---
|
||||
' ' Text.Whitespace
|
||||
'description' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"Some description"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'availability_zones' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'[' Punctuation
|
||||
'"${aws_instance.web.availability_zone}-foobar"' Literal.String.Double
|
||||
']' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'availability_zones' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'[' Punctuation
|
||||
'aws_instance.web.availability_zone' Name.Variable
|
||||
']' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'assume_role_policy' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'data.aws_iam_policy_document.trust.json' Name.Variable
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'policy_arn' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'aws_iam_policy.assume_roles[0].arn' Name.Variable
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' \n ' Text.Whitespace
|
||||
'value' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'file' Name.Function
|
||||
'(' Punctuation
|
||||
'"path.txt"' Literal.String.Double
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'value' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'jsonencode' Name.Function
|
||||
'(' Punctuation
|
||||
'element' Name.Function
|
||||
'(' Punctuation
|
||||
'"value"' Literal.String.Double
|
||||
')' Punctuation
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'tags' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'Name' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"something"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'"ENV_VARIABLE_1"' Literal.String.Double
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'aws_dynamodb_table.loginsights2metrics.name' Name.Variable
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'"ENV_VARIABLE_2"' Literal.String.Double
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"Some string"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'ignore_changes' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'[' Punctuation
|
||||
'last_modified, filename' Name.Builtin
|
||||
']' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'variable' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"aws:MultiFactorAuthPresent"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
44
spec/tests/terraform/test_backend.txt
Normal file
44
spec/tests/terraform/test_backend.txt
Normal file
@ -0,0 +1,44 @@
|
||||
---input---
|
||||
terraform {
|
||||
backend "consul" {
|
||||
address = "demo.consul.io"
|
||||
path = "tfdocs"
|
||||
}
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'terraform' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'backend' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"consul"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'address' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"demo.consul.io"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'path' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"tfdocs"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
64
spec/tests/terraform/test_comment.txt
Normal file
64
spec/tests/terraform/test_comment.txt
Normal file
@ -0,0 +1,64 @@
|
||||
---input---
|
||||
# Single line comment
|
||||
// Non-idiomatic single line comment
|
||||
/* multiline
|
||||
|
||||
comment
|
||||
|
||||
*/
|
||||
provider "azurerm" { # (1)
|
||||
features {}
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'# Single line comment\n' Comment.Single
|
||||
|
||||
'// Non-idiomatic single line comment\n' Comment.Single
|
||||
|
||||
'/*' Comment.Multiline
|
||||
' ' Comment.Multiline
|
||||
'm' Comment.Multiline
|
||||
'u' Comment.Multiline
|
||||
'l' Comment.Multiline
|
||||
't' Comment.Multiline
|
||||
'i' Comment.Multiline
|
||||
'l' Comment.Multiline
|
||||
'i' Comment.Multiline
|
||||
'n' Comment.Multiline
|
||||
'e' Comment.Multiline
|
||||
'\n' Comment.Multiline
|
||||
|
||||
'\n' Comment.Multiline
|
||||
|
||||
' ' Comment.Multiline
|
||||
' ' Comment.Multiline
|
||||
'c' Comment.Multiline
|
||||
'o' Comment.Multiline
|
||||
'm' Comment.Multiline
|
||||
'm' Comment.Multiline
|
||||
'e' Comment.Multiline
|
||||
'n' Comment.Multiline
|
||||
't' Comment.Multiline
|
||||
'\n' Comment.Multiline
|
||||
|
||||
'\n' Comment.Multiline
|
||||
|
||||
'*/' Comment.Multiline
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'provider' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"azurerm"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
' # (1)\n' Comment.Single
|
||||
|
||||
' ' Text.Whitespace
|
||||
'features' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
' \n' Text.Whitespace
|
56
spec/tests/terraform/test_functions.txt
Normal file
56
spec/tests/terraform/test_functions.txt
Normal file
@ -0,0 +1,56 @@
|
||||
---input---
|
||||
provider "aws" {
|
||||
value = file("path.txt")
|
||||
}
|
||||
|
||||
provider "aws" {
|
||||
value = jsonencode(element("value"))
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'provider' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'value' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'file' Name.Function
|
||||
'(' Punctuation
|
||||
'"path.txt"' Literal.String.Double
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'provider' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'value' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'jsonencode' Name.Function
|
||||
'(' Punctuation
|
||||
'element' Name.Function
|
||||
'(' Punctuation
|
||||
'"value"' Literal.String.Double
|
||||
')' Punctuation
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
65
spec/tests/terraform/test_heredoc.txt
Normal file
65
spec/tests/terraform/test_heredoc.txt
Normal file
@ -0,0 +1,65 @@
|
||||
---input---
|
||||
resource "local_file" "heredoc" {
|
||||
content = <<-DOC
|
||||
heredoc content
|
||||
DOC
|
||||
}
|
||||
|
||||
resource "local_file" "heredoc" {
|
||||
content = <<DOC
|
||||
heredoc content
|
||||
DOC
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'resource' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"local_file"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"heredoc"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'content' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'<<-' Operator
|
||||
'DOC' Literal.String.Delimiter
|
||||
'\n' Literal.String.Heredoc
|
||||
|
||||
' heredoc content\n' Literal.String.Heredoc
|
||||
|
||||
' DOC\n' Literal.String.Delimiter
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'resource' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"local_file"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"heredoc"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'content' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'<<' Operator
|
||||
'DOC' Literal.String.Delimiter
|
||||
'\n' Literal.String.Heredoc
|
||||
|
||||
' heredoc content\n' Literal.String.Heredoc
|
||||
|
||||
' DOC\n' Literal.String.Delimiter
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
32
spec/tests/terraform/test_module.txt
Normal file
32
spec/tests/terraform/test_module.txt
Normal file
@ -0,0 +1,32 @@
|
||||
---input---
|
||||
module "consul" {
|
||||
source = "hashicorp/consul/aws"
|
||||
servers = 3
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'module' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"consul"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'source' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"hashicorp/consul/aws"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'servers' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'3' Literal.Number
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
211
spec/tests/terraform/test_resource.txt
Normal file
211
spec/tests/terraform/test_resource.txt
Normal file
@ -0,0 +1,211 @@
|
||||
---input---
|
||||
resource "aws_internet_gateway" "base_igw" {
|
||||
vpc_id = aws_vpc.something.id
|
||||
tags = {
|
||||
Name = "igw-${var.something}-${var.something}"
|
||||
}
|
||||
}
|
||||
|
||||
resource "aws_security_group" "allow_tls" {
|
||||
name = "allow_tls"
|
||||
description = "Allow TLS inbound traffic"
|
||||
vpc_id = aws_vpc.main.id
|
||||
|
||||
# Ingress rules
|
||||
ingress {
|
||||
description = "TLS from VPC"
|
||||
from_port = 443
|
||||
to_port = 443
|
||||
}
|
||||
|
||||
# Egress rules
|
||||
egress {
|
||||
from_port = 0
|
||||
to_port = 0
|
||||
protocol = "-1"
|
||||
cidr_blocks = ["0.0.0.0/0"]
|
||||
}
|
||||
|
||||
tags = {
|
||||
Name = "allow_tls"
|
||||
}
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'resource' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_internet_gateway"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"base_igw"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'vpc_id' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'aws_vpc.something.id' Name.Variable
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'tags' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'Name' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"igw-${var.something}-${var.something}"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'resource' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_security_group"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"allow_tls"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'name' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"allow_tls"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'description' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"Allow TLS inbound traffic"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'vpc_id' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'aws_vpc.main.id' Name.Variable
|
||||
'\n\n # Ingress rules\n' Comment.Single
|
||||
|
||||
' ' Text.Whitespace
|
||||
'ingress' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'description' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"TLS from VPC"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'from_port' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'443' Literal.Number
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'to_port' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'443' Literal.Number
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n\n # Egress rules\n' Comment.Single
|
||||
|
||||
' ' Text.Whitespace
|
||||
'egress' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'from_port' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'0' Literal.Number
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'to_port' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'0' Literal.Number
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'protocol' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"-1"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'cidr_blocks' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'[' Punctuation
|
||||
'"0.0.0.0/0"' Literal.String.Double
|
||||
']' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'tags' Name.Builtin
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'Name' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"allow_tls"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
94
spec/tests/terraform/test_types.txt
Normal file
94
spec/tests/terraform/test_types.txt
Normal file
@ -0,0 +1,94 @@
|
||||
---input---
|
||||
backend "consul" {
|
||||
data "aws_ami" "example" {
|
||||
module "consul" {
|
||||
output "instance_ip_addr" {
|
||||
provider "aws" {
|
||||
provisioner "local-exec" {
|
||||
resource "aws_internet_gateway" "base_igw" {
|
||||
variable "aws_region" {
|
||||
variable "set-str" {
|
||||
type = set(string)
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'backend' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"consul"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'data' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_ami"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"example"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'module' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"consul"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'output' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"instance_ip_addr"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'provider' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'provisioner' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"local-exec"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'resource' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_internet_gateway"' Name.Class
|
||||
' ' Text.Whitespace
|
||||
'"base_igw"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'variable' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_region"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'variable' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"set-str"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'type' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'set' Keyword.Type
|
||||
'(' Punctuation
|
||||
'string' Keyword.Type
|
||||
')' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
41
spec/tests/terraform/test_variable_declaration.txt
Normal file
41
spec/tests/terraform/test_variable_declaration.txt
Normal file
@ -0,0 +1,41 @@
|
||||
---input---
|
||||
variable "aws_region" {
|
||||
description = "AWS region to launch servers."
|
||||
default = "us-west-2"
|
||||
somevar = true
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'variable' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws_region"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'description' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"AWS region to launch servers."' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'default' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'"us-west-2"' Literal.String.Double
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'somevar' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'true' Name.Constant
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
23
spec/tests/terraform/test_variable_read.txt
Normal file
23
spec/tests/terraform/test_variable_read.txt
Normal file
@ -0,0 +1,23 @@
|
||||
---input---
|
||||
provider "aws" {
|
||||
region = var.aws_region
|
||||
}
|
||||
|
||||
---tokens---
|
||||
'provider' Keyword.Reserved
|
||||
' ' Text.Whitespace
|
||||
'"aws"' Name.Variable
|
||||
' ' Text.Whitespace
|
||||
'{' Punctuation
|
||||
'\n' Text.Whitespace
|
||||
|
||||
' ' Text.Whitespace
|
||||
'region' Name.Attribute
|
||||
' ' Text.Whitespace
|
||||
'=' Operator
|
||||
' ' Text.Whitespace
|
||||
'var.aws_region' Name.Variable
|
||||
'\n' Text.Whitespace
|
||||
|
||||
'}' Punctuation
|
||||
'\n' Text.Whitespace
|
Reference in New Issue
Block a user