summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorGreg Dubicki <grzegorz.dubicki@gmail.com>2022-11-14 11:29:22 +0000
committerGeorg Brandl <georg@python.org>2022-11-14 14:59:14 +0100
commit9aa5fc0185a6c8fa82337af02ebc78dbed90dac8 (patch)
tree9a8a0b1b434450436c25bb8e56b4ac3b466fa291 /tests
parent8abbd68251af1c551daed8d5ffafb14d2e95d9a8 (diff)
downloadpygments-git-9aa5fc0185a6c8fa82337af02ebc78dbed90dac8.tar.gz
Accept colon(s) in YAML key names
as it's ok according to the YAML specs and is widely used in the real world, f.e. in Puppet's Hiera (https://puppet.com/docs/puppet/7/hiera_quick.html#values_common_data)
Diffstat (limited to 'tests')
-rw-r--r--tests/snippets/yaml/test_yaml_colon_in_key.txt11
-rw-r--r--tests/snippets/yaml/test_yaml_colon_in_key_double.txt11
-rw-r--r--tests/snippets/yaml/test_yaml_colon_in_key_start.txt11
3 files changed, 33 insertions, 0 deletions
diff --git a/tests/snippets/yaml/test_yaml_colon_in_key.txt b/tests/snippets/yaml/test_yaml_colon_in_key.txt
new file mode 100644
index 00000000..9f3d3136
--- /dev/null
+++ b/tests/snippets/yaml/test_yaml_colon_in_key.txt
@@ -0,0 +1,11 @@
+# Colon in the key name is accepted by the YAML specs too
+
+---input---
+foo:bar: value
+
+---tokens---
+'foo:bar' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'value' Literal.Scalar.Plain
+'\n' Text.Whitespace
diff --git a/tests/snippets/yaml/test_yaml_colon_in_key_double.txt b/tests/snippets/yaml/test_yaml_colon_in_key_double.txt
new file mode 100644
index 00000000..6f68b6d3
--- /dev/null
+++ b/tests/snippets/yaml/test_yaml_colon_in_key_double.txt
@@ -0,0 +1,11 @@
+# Colons in the key name is accepted by the YAML specs too
+
+---input---
+foo::bar: value
+
+---tokens---
+'foo::bar' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'value' Literal.Scalar.Plain
+'\n' Text.Whitespace
diff --git a/tests/snippets/yaml/test_yaml_colon_in_key_start.txt b/tests/snippets/yaml/test_yaml_colon_in_key_start.txt
new file mode 100644
index 00000000..60d4e234
--- /dev/null
+++ b/tests/snippets/yaml/test_yaml_colon_in_key_start.txt
@@ -0,0 +1,11 @@
+# Colon at the beginning of the key name is accepted by the YAML specs too
+
+---input---
+:foo: value
+
+---tokens---
+':foo' Name.Tag
+':' Punctuation
+' ' Text.Whitespace
+'value' Literal.Scalar.Plain
+'\n' Text.Whitespace