Skip to content

Commit

Permalink
specsuite: a few additional tests for structure
Browse files Browse the repository at this point in the history
This is still not fully comprehensive, but tests some basic functionality.
  • Loading branch information
apparentlymart committed Aug 13, 2018
1 parent 74466f4 commit 12f0f2d
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 0 deletions.
4 changes: 4 additions & 0 deletions specsuite/tests/structure/attributes/unexpected.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
a = "a value"
b = "b value"
c = "c value"
d = "d value"
11 changes: 11 additions & 0 deletions specsuite/tests/structure/attributes/unexpected.hcldec
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
object {
attr "a" {
type = string
}
attr "b" {
type = string
}
attr "d" {
type = string
}
}
15 changes: 15 additions & 0 deletions specsuite/tests/structure/attributes/unexpected.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diagnostics {
error {
# An argument named "c" is not expected here.
from {
line = 3
column = 1
byte = 28
}
to {
line = 3
column = 2
byte = 29
}
}
}
1 change: 1 addition & 0 deletions specsuite/tests/structure/blocks/single_empty_oneline.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a {}
4 changes: 4 additions & 0 deletions specsuite/tests/structure/blocks/single_empty_oneline.hcldec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
block {
block_type = "a"
object {}
}
1 change: 1 addition & 0 deletions specsuite/tests/structure/blocks/single_empty_oneline.t
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
result_type = object({})
3 changes: 3 additions & 0 deletions specsuite/tests/structure/blocks/single_expected.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
a {

}
4 changes: 4 additions & 0 deletions specsuite/tests/structure/blocks/single_expected.hcldec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
block {
block_type = "a"
object {}
}
1 change: 1 addition & 0 deletions specsuite/tests/structure/blocks/single_expected.t
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
result_type = object({})
1 change: 1 addition & 0 deletions specsuite/tests/structure/blocks/single_unclosed.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
a {
4 changes: 4 additions & 0 deletions specsuite/tests/structure/blocks/single_unclosed.hcldec
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
block {
block_type = "a"
object {}
}
14 changes: 14 additions & 0 deletions specsuite/tests/structure/blocks/single_unclosed.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diagnostics {
error {
from {
line = 2
column = 1
byte = 4
}
to {
line = 2
column = 1
byte = 4
}
}
}

0 comments on commit 12f0f2d

Please sign in to comment.