File: primitive_literals.t

package info (click to toggle)
golang-github-hashicorp-hcl-v2 2.14.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 3,120 kB
  • sloc: ruby: 205; makefile: 72; python: 43; sh: 11
file content (34 lines) | stat: -rw-r--r-- 1,292 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
result_type = object({
  whole_number                = number
  fractional_number           = number
  fractional_number_precision = number
  string_ascii                = string
  string_unicode_bmp          = string
  string_unicode_astral       = string
  string_unicode_nonnorm      = string
  true                        = bool
  false                       = bool
  null                        = any
})
result = {
  # Numbers
  whole_number                = 5
  fractional_number           = 3.2
  fractional_number_precision = 3.14159265358979323846264338327950288419716939937510582097494459

  # Strings
  string_ascii = "hello"
  string_unicode_bmp = "ЖЖ"
  string_unicode_astral = "👩‍👩‍👧‍👦"
  string_unicode_nonnorm = "años" # now a precomposed ñ, because HCL imposes NFC normalization
  # FIXME: The above normalization test doesn't necessarily test what it thinks
  # it is testing, because this file is also HCL and thus subject to
  # normalization; as long as the parser normalizes consistently this could
  # pass even if it's using a different normalization form.

  # The left hand side of these are quoted to make it clear that we're expecting
  # to get strings here, not really true/false/null.
  "true"  = true
  "false" = false
  "null"  = null
}