Skip to content

Commit

Permalink
Update any instane of 'carrot' to 'L/R_ANGLE', and add L_ANGLES to ty…
Browse files Browse the repository at this point in the history
…pes.py (#165)
  • Loading branch information
beeankha authored Sep 30, 2024
1 parent 11c33af commit b6c0289
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 21 deletions.
9 changes: 6 additions & 3 deletions conda_recipe_manager/parser/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,9 @@ class MultilineVariant(StrEnum):
PIPE = "|"
PIPE_PLUS = "|+"
PIPE_MINUS = "|-"
CARROT = ">"
CARROT_PLUS = ">+"
CARROT_MINUS = ">-"
R_ANGLE = ">"
R_ANGLE_PLUS = ">+"
R_ANGLE_MINUS = ">-"
L_ANGLE = "<"
L_ANGLE_PLUS = "<+"
L_ANGLE_MINUS = "<-"
36 changes: 18 additions & 18 deletions tests/parser/test_recipe_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@
QUICK_FOX_PIPE: Final[str] = "The quick brown\n{{fox}}\n\njumped over the lazy dog\n"
QUICK_FOX_PIPE_PLUS: Final[str] = "The quick brown\n{{fox}}\n\njumped over the lazy dog\n"
QUICK_FOX_PIPE_MINUS: Final[str] = "The quick brown\n{{fox}}\n\njumped over the lazy dog"
QUICK_FOX_CARROT: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog\n"
QUICK_FOX_CARROT_PLUS: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog\n"
QUICK_FOX_CARROT_MINUS: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog"
QUICK_FOX_R_ANGLE: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog\n"
QUICK_FOX_R_ANGLE_PLUS: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog\n"
QUICK_FOX_R_ANGLE_MINUS: Final[str] = "The quick brown {{fox}}\njumped over the lazy dog"
# Substitution variants of the multiline string
QUICK_FOX_SUB_PIPE: Final[str] = "The quick brown\ntiger\n\njumped over the lazy dog\n"
QUICK_FOX_SUB_PIPE_PLUS: Final[str] = "The quick brown\ntiger\n\njumped over the lazy dog\n"
QUICK_FOX_SUB_PIPE_MINUS: Final[str] = "The quick brown\ntiger\n\njumped over the lazy dog"
QUICK_FOX_SUB_CARROT: Final[str] = "The quick brown tiger\njumped over the lazy dog\n"
QUICK_FOX_SUB_CARROT_PLUS: Final[str] = "The quick brown tiger\njumped over the lazy dog\n"
QUICK_FOX_SUB_CARROT_MINUS: Final[str] = "The quick brown tiger\njumped over the lazy dog"
QUICK_FOX_L_ANGLE: Final[str] = "The quick brown tiger\njumped over the lazy dog\n"
QUICK_FOX_L_ANGLE_PLUS: Final[str] = "The quick brown tiger\njumped over the lazy dog\n"
QUICK_FOX_L_ANGLE_MINUS: Final[str] = "The quick brown tiger\njumped over the lazy dog"


## Construction and rendering sanity checks ##
Expand Down Expand Up @@ -235,9 +235,9 @@ def test_round_trip(file: str) -> None:
"description0": QUICK_FOX_PIPE,
"description1": QUICK_FOX_PIPE_PLUS,
"description2": QUICK_FOX_PIPE_MINUS,
"description3": QUICK_FOX_CARROT,
"description4": QUICK_FOX_CARROT_PLUS,
"description5": QUICK_FOX_CARROT_MINUS,
"description3": QUICK_FOX_R_ANGLE,
"description4": QUICK_FOX_R_ANGLE_PLUS,
"description5": QUICK_FOX_R_ANGLE_MINUS,
"license": "Apache-2.0 AND MIT",
"summary": "This is a small recipe for testing",
},
Expand All @@ -263,9 +263,9 @@ def test_round_trip(file: str) -> None:
"description0": QUICK_FOX_SUB_PIPE,
"description1": QUICK_FOX_SUB_PIPE_PLUS,
"description2": QUICK_FOX_SUB_PIPE_MINUS,
"description3": QUICK_FOX_SUB_CARROT,
"description4": QUICK_FOX_SUB_CARROT_PLUS,
"description5": QUICK_FOX_SUB_CARROT_MINUS,
"description3": QUICK_FOX_L_ANGLE,
"description4": QUICK_FOX_L_ANGLE_PLUS,
"description5": QUICK_FOX_L_ANGLE_MINUS,
"license": "Apache-2.0 AND MIT",
"summary": "This is a small recipe for testing",
},
Expand Down Expand Up @@ -573,16 +573,16 @@ def test_contains_value(file: str, path: str, expected: bool) -> None:
("simple-recipe_multiline_strings.yaml", "/about/description0", False, QUICK_FOX_PIPE),
("simple-recipe_multiline_strings.yaml", "/about/description1", False, QUICK_FOX_PIPE_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description2", False, QUICK_FOX_PIPE_MINUS),
("simple-recipe_multiline_strings.yaml", "/about/description3", False, QUICK_FOX_CARROT),
("simple-recipe_multiline_strings.yaml", "/about/description4", False, QUICK_FOX_CARROT_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description5", False, QUICK_FOX_CARROT_MINUS),
("simple-recipe_multiline_strings.yaml", "/about/description3", False, QUICK_FOX_R_ANGLE),
("simple-recipe_multiline_strings.yaml", "/about/description4", False, QUICK_FOX_R_ANGLE_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description5", False, QUICK_FOX_R_ANGLE_MINUS),
# Return multiline string variants, with substitution
("simple-recipe_multiline_strings.yaml", "/about/description0", True, QUICK_FOX_SUB_PIPE),
("simple-recipe_multiline_strings.yaml", "/about/description1", True, QUICK_FOX_SUB_PIPE_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description2", True, QUICK_FOX_SUB_PIPE_MINUS),
("simple-recipe_multiline_strings.yaml", "/about/description3", True, QUICK_FOX_SUB_CARROT),
("simple-recipe_multiline_strings.yaml", "/about/description4", True, QUICK_FOX_SUB_CARROT_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description5", True, QUICK_FOX_SUB_CARROT_MINUS),
("simple-recipe_multiline_strings.yaml", "/about/description3", True, QUICK_FOX_L_ANGLE),
("simple-recipe_multiline_strings.yaml", "/about/description4", True, QUICK_FOX_L_ANGLE_PLUS),
("simple-recipe_multiline_strings.yaml", "/about/description5", True, QUICK_FOX_L_ANGLE_MINUS),
## types-toml.yaml ##
# Regression: `{ name[0] }` could not be evaluated.
(
Expand Down

0 comments on commit b6c0289

Please sign in to comment.