# from https://github.com/cooklang/spec/blob/ffcd099a8990ec7ffeb9835f0b9cde0b94780841/tests/canonical.yaml # commented tests are not passing at the moment version: 6 tests: testBasicDirection: source: | Add a bit of chilli result: steps: - - type: text value: "Add a bit of chilli" metadata: {} testComments: source: | -- testing comments result: steps: [] metadata: {} testCommentsAfterIngredients: source: | @thyme{2%sprigs} -- testing comments and some text result: steps: - - type: ingredient name: "thyme" quantity: 2 units: "sprigs" - type: text value: " " - - type: text value: "and some text" metadata: {} testCommentsWithIngredients: source: | -- testing comments @thyme{2%sprigs} result: steps: - - type: ingredient name: "thyme" quantity: 2 units: "sprigs" metadata: {} testDirectionsWithDegrees: source: | Heat oven up to 200°C result: steps: - - type: text value: "Heat oven up to 200°C" metadata: {} testDirectionsWithNumbers: source: | Heat 5L of water result: steps: - - type: text value: "Heat 5L of water" metadata: {} testDirectionWithIngredient: source: | Add @chilli{3%items}, @ginger{10%g} and @milk{1%l}. result: steps: - - type: text value: "Add " - type: ingredient name: "chilli" quantity: 3 units: "items" - type: text value: ", " - type: ingredient name: "ginger" quantity: 10 units: "g" - type: text value: " and " - type: ingredient name: "milk" quantity: 1 units: "l" - type: text value: "." metadata: {} testEquipmentMultipleWords: source: | Fry in #frying pan{} result: steps: - - type: text value: "Fry in " - type: cookware name: "frying pan" quantity: 1 metadata: {} testEquipmentMultipleWordsWithLeadingNumber: source: | Fry in #7-inch nonstick frying pan{ } result: steps: - - type: text value: "Fry in " - type: cookware name: "7-inch nonstick frying pan" quantity: 1 metadata: {} testEquipmentMultipleWordsWithSpaces: source: | Fry in #frying pan{ } result: steps: - - type: text value: "Fry in " - type: cookware name: "frying pan" quantity: 1 metadata: {} testEquipmentOneWord: source: | Simmer in #pan for some time result: steps: - - type: text value: "Simmer in " - type: cookware name: "pan" quantity: 1 - type: text value: " for some time" metadata: {} testEquipmentQuantity: source: | #frying pan{2} result: steps: - - type: cookware name: "frying pan" quantity: 2 metadata: {} testEquipmentQuantityOneWord: source: | #frying pan{three} result: steps: - - type: cookware name: "frying pan" quantity: three metadata: {} testEquipmentQuantityMultipleWords: source: | #frying pan{two small} result: steps: - - type: cookware name: "frying pan" quantity: two small metadata: {} testFractions: source: | @milk{1/2%cup} result: steps: - - type: ingredient name: "milk" quantity: 0.5 units: "cup" metadata: {} testFractionsInDirections: source: | knife cut about every 1/2 inches result: steps: - - type: text value: "knife cut about every 1/2 inches" metadata: {} testFractionsLike: source: | @milk{01/2%cup} result: steps: - - type: ingredient name: "milk" quantity: "01/2" units: "cup" metadata: {} testFractionsWithSpaces: source: | @milk{1 / 2 %cup} result: steps: - - type: ingredient name: "milk" quantity: 0.5 units: "cup" metadata: {} testIngredientMultipleWordsWithLeadingNumber: source: | Top with @1000 island dressing{ } result: steps: - - type: text value: "Top with " - type: ingredient name: "1000 island dressing" quantity: "some" units: "" metadata: {} testIngredientWithEmoji: source: | Add some @🧂 result: steps: - - type: text value: "Add some " - type: ingredient name: "🧂" quantity: "some" units: "" metadata: {} testIngredientExplicitUnits: source: | @chilli{3%items} result: steps: - - type: ingredient name: "chilli" quantity: 3 units: "items" metadata: {} testIngredientExplicitUnitsWithSpaces: source: | @chilli{ 3 % items } result: steps: - - type: ingredient name: "chilli" quantity: 3 units: "items" metadata: {} testIngredientImplicitUnits: source: | @chilli{3} result: steps: - - type: ingredient name: "chilli" quantity: 3 units: "" metadata: {} testIngredientNoUnits: source: | @chilli result: steps: - - type: ingredient name: "chilli" quantity: "some" units: "" metadata: {} testIngredientNoUnitsNotOnlyString: source: | @5peppers result: steps: - - type: ingredient name: "5peppers" quantity: "some" units: "" metadata: {} testIngredientWithNumbers: source: | @tipo 00 flour{250%g} result: steps: - - type: ingredient name: "tipo 00 flour" quantity: 250 units: "g" metadata: {} testIngredientWithoutStopper: source: | @chilli cut into pieces result: steps: - - type: ingredient name: "chilli" quantity: "some" units: "" - type: text value: " cut into pieces" metadata: {} testMetadata: source: | >> sourced: babooshka result: steps: [] metadata: "sourced": babooshka testMetadataBreak: source: | hello >> sourced: babooshka result: steps: - - type: text value: "hello >> sourced: babooshka" metadata: {} testMetadataMultiwordKey: source: | >> cooking time: 30 mins result: steps: [] metadata: "cooking time": 30 mins testMetadataMultiwordKeyWithSpaces: source: | >>cooking time :30 mins result: steps: [] metadata: "cooking time": 30 mins testMultiLineDirections: source: | Add a bit of chilli Add a bit of hummus result: steps: - - type: text value: "Add a bit of chilli" - - type: text value: "Add a bit of hummus" metadata: {} testMultipleLines: source: | >> Prep Time: 15 minutes >> Cook Time: 30 minutes result: steps: [] metadata: "Prep Time": 15 minutes "Cook Time": 30 minutes testMultiWordIngredient: source: | @hot chilli{3} result: steps: - - type: ingredient name: "hot chilli" quantity: 3 units: "" metadata: {} testMultiWordIngredientNoAmount: source: | @hot chilli{} result: steps: - - type: ingredient name: "hot chilli" quantity: "some" units: "" metadata: {} testMutipleIngredientsWithoutStopper: source: | @chilli cut into pieces and @garlic result: steps: - - type: ingredient name: "chilli" quantity: "some" units: "" - type: text value: " cut into pieces and " - type: ingredient name: "garlic" quantity: "some" units: "" metadata: {} testQuantityAsText: source: | @thyme{few%sprigs} result: steps: - - type: ingredient name: "thyme" quantity: few units: "sprigs" metadata: {} testQuantityDigitalString: source: | @water{7 k } result: steps: - - type: ingredient name: "water" quantity: 7 k units: "" metadata: {} testServings: source: | >> servings: 1|2|3 result: steps: [] metadata: "servings": 1|2|3 testSlashInText: source: | Preheat the oven to 200℃/Fan 180°C. result: steps: - - type: text value: "Preheat the oven to 200℃/Fan 180°C." metadata: {} testTimerDecimal: source: | Fry for ~{1.5%minutes} result: steps: - - type: text value: "Fry for " - type: timer quantity: 1.5 units: "minutes" name: "" metadata: {} testTimerFractional: source: | Fry for ~{1/2%hour} result: steps: - - type: text value: "Fry for " - type: timer quantity: 0.5 units: "hour" name: "" metadata: {} testTimerInteger: source: | Fry for ~{10%minutes} result: steps: - - type: text value: "Fry for " - type: timer quantity: 10 units: "minutes" name: "" metadata: {} testTimerWithName: source: | Fry for ~potato{42%minutes} result: steps: - - type: text value: "Fry for " - type: timer quantity: 42 units: "minutes" name: "potato" metadata: {} testSingleWordTimer: source: | Let it ~rest after plating result: steps: - - type: text value: "Let it " - type: timer quantity: "" units: "" name: "rest" - type: text value: " after plating" metadata: {} testSingleWordTimerWithPunctuation: source: | Let it ~rest, then serve result: steps: - - type: text value: "Let it " - type: timer quantity: "" units: "" name: "rest" - type: text value: ", then serve" metadata: {} testSingleWordTimerWithUnicodePunctuation: source: | Let it ~rest⸫ then serve result: steps: - - type: text value: "Let it " - type: timer quantity: "" units: "" name: "rest" - type: text value: "⸫ then serve" metadata: {} # NOTE: the space following `rest` is U+2009 testTimerWithUnicodeWhitespace: source: | Let it ~rest then serve result: steps: - - type: text value: "Let it " - type: timer quantity: "" units: "" name: "rest" - type: text value: " then serve" metadata: {} # testInvalidMultiWordTimer: # source: | # It is ~ {5} # result: # steps: # - # - type: text # value: "It is ~ {5}" # metadata: {} testInvalidSingleWordTimer: source: | It is ~ 5 result: steps: - - type: text value: "It is ~ 5" metadata: {} testSingleWordIngredientWithPunctuation: source: | Add some @chilli, then serve result: steps: - - type: text value: "Add some " - type: ingredient quantity: "some" units: "" name: "chilli" - type: text value: ", then serve" metadata: {} testSingleWordIngredientWithUnicodePunctuation: source: | Add @chilli⸫ then bake result: steps: - - type: text value: "Add " - type: ingredient quantity: "some" units: "" name: "chilli" - type: text value: "⸫ then bake" metadata: {} # NOTE: the space following `chilli` is U+2009 testIngredientWithUnicodeWhitespace: source: | Add @chilli then bake result: steps: - - type: text value: "Add " - type: ingredient quantity: "some" units: "" name: "chilli" - type: text value: " then bake" metadata: {} # testInvalidMultiWordIngredient: # source: | # Message @ example{} # result: # steps: # - # - type: text # value: "Message @ example{}" # metadata: {} testInvalidSingleWordIngredient: source: | Message me @ example result: steps: - - type: text value: "Message me @ example" metadata: {} testSingleWordCookwareWithPunctuation: source: | Place in #pot, then boil result: steps: - - type: text value: "Place in " - type: cookware quantity: 1 units: "" name: "pot" - type: text value: ", then boil" metadata: {} testSingleWordCookwareWithUnicodePunctuation: source: | Place in #pot⸫ then boil result: steps: - - type: text value: "Place in " - type: cookware quantity: 1 units: "" name: "pot" - type: text value: "⸫ then boil" metadata: {} # NOTE: the space following `pot` is U+2009 testCookwareWithUnicodeWhitespace: source: | Add to #pot then boil result: steps: - - type: text value: "Add to " - type: cookware quantity: 1 units: "" name: "pot" - type: text value: " then boil" metadata: {} # testInvalidMultiWordCookware: # source: | # Recipe # 10{} # result: # steps: # - # - type: text # value: "Recipe # 10{}" # metadata: {} testInvalidSingleWordCookware: source: | Recipe # 5 result: steps: - - type: text value: "Recipe # 5" metadata: {} # NOTE: Unicode newlines may be impossible to test using YAML, # given how the markup uses them for semantic reasoning. # TODO add common syntax errors