Skip to content

Commit

Permalink
test: update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotfontaine committed Sep 26, 2024
1 parent 83aaa6e commit e27fb44
Show file tree
Hide file tree
Showing 11 changed files with 342 additions and 105 deletions.
26 changes: 16 additions & 10 deletions test/corpus/comments.txt
Original file line number Diff line number Diff line change
@@ -1,26 +1,32 @@
========|||
========
Comments
========|||
========

# Header comment
[some-section]
key = value
[other-root] # a comment here ?!
just a key = with a value #and a comment without space
just a key = with a value # and a comment without space

---|||
---

(configuration_file
(workflow_configuration
(comment)
(root_section
(top_section
name: (nametag)
(setting
key: (key)
value: (unquoted_string)))
(root_section
operator: (assignment_operator)
value: (unquoted_string
(string_content)
(string_content))))
(top_section
name: (nametag)
(comment)
(setting
key: (key)
value: (unquoted_string)))
(comment))
operator: (assignment_operator)
value: (unquoted_string
(string_content)
(string_content))
(comment))))
46 changes: 42 additions & 4 deletions test/corpus/datetime.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=================|||
=================
ISO 8601 Datetime
=================|||
=================

[section]
datetime_extended1 = 2024-09-19T21:27:12Z
Expand All @@ -13,6 +13,44 @@ datetime_extended7 = 2024-09-19T21:27+02:00
datetime_basic1 = 20240919T212712Z
datetime_basic2 = 20240919T2127

---|||
---

TODO
(workflow_configuration
(top_section
(nametag)
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))
(setting
(key)
(assignment_operator)
(datetime))))
19 changes: 12 additions & 7 deletions test/corpus/include-statements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
==================|||
==================
Include Statements
==================|||
==================

# Some header comment here. This is not an %include statement.
%include "file.cylc"
Expand All @@ -9,20 +9,25 @@ Include Statements
[other-root] # a comment here ?!
just a key = with a value

---|||
---

(configuration_file
(workflow_configuration
(comment)
(include_statement
directive: (include_directive)
path: (quoted_string))
(root_section
(top_section
name: (nametag))
(include_statement
directive: (include_directive)
path: (quoted_string))
(comment)
(root_section
(top_section
name: (nametag)
(comment)
(setting
key: (key)
value: (unquoted_string))))
operator: (assignment_operator)
value: (unquoted_string
(string_content)
(string_content)))))
29 changes: 16 additions & 13 deletions test/corpus/jinja2.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
=======================================|||
=======================================
Jinja2 (Statement, Expression, Comment)
=======================================|||
:skip
=======================================

# {% stating something %} is for Statements
# {{ expressing something }} is for Expressions
Expand All @@ -16,37 +17,39 @@ Jinja2 (Statement, Expression, Comment)
[[environment]]
INFLUXDB_{{ param }}_TEST = 1{{ id_fragment }}8
INFLUXDB_V2_URL = {{ cfg__influxdb_url }}
INFLUXDB_V2_ORG = "org-{{ cfg__influxdb_org }}"
INFLUXDB_V2_ORG = "org-{{ cfg__influxdb_org }}-2"
INFLUXDB_V2_TOKEN = {{ cfg__influxdb_auth_token }}

---|||
---

(configuration_file
(workflow_configuration
(comment
(jinja2_statement))
(comment
(jinja2_expression))
(comment
(jinja2_comment))
(root_section
(top_section
name: (nametag)
(subsection_1
(sub_section_1
name: (nametag)
(jinja2_statement)
(jinja2_statement)
(setting
key: (key)
value: (unquoted_string))
(jinja2_statement)
(jinja2_statement)
(setting
key: (key)
value: (unquoted_string)
(jinja2_expression)))
(jinja2_statement)
(subsection_1
(jinja2_statement)
(sub_section_1
name: (nametag)
(setting
key: (key (jinja2_expression))
value: (number (jinja2_expression)))
key: (key
(jinja2_expression))
value: (integer
(jinja2_expression)))
(setting
key: (key)
(jinja2_expression))
Expand Down
35 changes: 20 additions & 15 deletions test/corpus/multilines-strings-2.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=======================|||
=======================
Multi-lines Strings (2)
=======================|||
=======================

[runtime]
[[convert_raw]]
Expand All @@ -14,18 +14,23 @@ Multi-lines Strings (2)
[[[meta]]]
title = Convert Raw

---|||
---

(configuration_file
(root_section
(workflow_configuration
(top_section
name: (nametag)
(sub_section_1
name: (nametag)
(setting
key: (key)
operator: (assignment_operator)
value: (multiline_string
(string_content)))
(sub_section_2
name: (nametag)
(subsection_1
name: (nametag)
(setting
key: (key)
value: (multiline_string))
(subsection_2
name: (nametag)
(setting
key: (key)
value: (unquoted_string))))))
(setting
key: (key)
operator: (assignment_operator)
value: (unquoted_string
(string_content)
(string_content)))))))
35 changes: 20 additions & 15 deletions test/corpus/multilines-strings-3.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
=======================|||
=======================
Multi-lines Strings (3)
=======================|||
=======================

[runtime]
[[root]]
Expand All @@ -14,18 +14,23 @@ Multi-lines Strings (3)
[[[environment]]]
USER_CONFIG_DIR = ${CYLC_WORKFLOW_RUN_DIR}/config

---|||
---

(configuration_file
(root_section
(workflow_configuration
(top_section
name: (nametag)
(sub_section_1
name: (nametag)
(setting
key: (key)
operator: (assignment_operator)
value: (multiline_string
(string_content)))
(sub_section_2
name: (nametag)
(subsection_1
name: (nametag)
(setting
key: (key)
value: (multiline_string))
(subsection_2
name: (nametag)
(setting
key: (key)
value: (unquoted_string))))))
(setting
key: (key)
operator: (assignment_operator)
value: (unquoted_string
(string_content)
(string_content)))))))
24 changes: 15 additions & 9 deletions test/corpus/multilines-strings.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===================|||
===================
Multi-lines Strings
===================|||
===================

[some-section]
key = """
Expand All @@ -15,19 +15,25 @@ Multi-lines Strings
value
'''

---|||
---

(configuration_file
(root_section
(workflow_configuration
(top_section
name: (nametag)
(setting
key: (key)
value: (multiline_string))
operator: (assignment_operator)
value: (multiline_string
(string_content)))
(setting
key: (key)
value: (multiline_string)))
(root_section
operator: (assignment_operator)
value: (multiline_string
(string_content))))
(top_section
name: (nametag)
(setting
key: (key)
value: (multiline_string))))
operator: (assignment_operator)
value: (multiline_string
(string_content)))))
19 changes: 11 additions & 8 deletions test/corpus/quoted-strings.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
==============|||
==============
Quoted Strings
==============|||
==============

[some-section]
key="String is quoted."
another-key = "This one \"too. #not a comment" # And real comment
[other-root]
just a key = "Quote with 'single quotes' inside"

---|||
---

(configuration_file
(root_section
(workflow_configuration
(top_section
name: (nametag)
(setting
key: (key)
operator: (assignment_operator)
value: (quoted_string))
(setting
key: (key)
value: (quoted_string)))
(comment)
(root_section
operator: (assignment_operator)
value: (quoted_string)
(comment)))
(top_section
name: (nametag)
(setting
key: (key)
operator: (assignment_operator)
value: (quoted_string))))
Loading

0 comments on commit e27fb44

Please sign in to comment.