Difference between revisions of "Processing test"
Line 4: | Line 4: | ||
== Template == | == Template == | ||
− | The template for | + | The template for an ingredient and process test is described here: |
[ { | [ { | ||
− | Define the language for which the tests are applicable. | + | Define the language ('''lc''') for which the tests are applicable, for example dutch (''nl''). |
− | lc => " | + | lc => "nl", |
− | Define in the ingredients_text the | + | Define in the '''ingredients_text''' the process- ingredient combination that must be tested. These should have the format process ingredient, ingredient process, or whatever is applicable for that language. |
ingredients_text => "raw milk, sliced tomatoes, garlic powder, powdered eggplant, courgette powder" }, | ingredients_text => "raw milk, sliced tomatoes, garlic powder, powdered eggplant, courgette powder" }, | ||
Line 44: | Line 44: | ||
} | } | ||
] ] | ] ] | ||
+ | |||
== Error message == | == Error message == | ||
# Failed test at t/ingredients_processing.t line 143. | # Failed test at t/ingredients_processing.t line 143. |
Revision as of 14:33, 24 March 2020
All tests follow the same structure. There is one test set per test language. Each test set consists of multiple tests. Each test check the correct parsing and interpretation of a processed ingredient. A processed ingredient consists of a process, taken from the ingredients processing taxonomy and an ingredient form the ingredients taxonomy.
Template
The template for an ingredient and process test is described here:
[ {
Define the language (lc) for which the tests are applicable, for example dutch (nl).
lc => "nl",
Define in the ingredients_text the process- ingredient combination that must be tested. These should have the format process ingredient, ingredient process, or whatever is applicable for that language.
ingredients_text => "raw milk, sliced tomatoes, garlic powder, powdered eggplant, courgette powder" },
The ingredients_text raw milk, should result in the ingredient with id en: raw milk. The adjective is ignored.
[ { 'id' => 'en:raw-milk', 'text' => 'raw milk' },
The ingredients_text sliced tomatoes, should result in the ingredient with id en:tomato and processing en:sliced.
{ 'id' => 'en:tomato',
The id represents the parent key of sliced tomatoes in the ingredients taxonomy.
'processing' => 'en:sliced',
The processing is the key of sliced in the processing taxonomy.
'text' => 'tomatoes'
The text is parent key of the entry sliced tomatoes in the ingredients taxonomy ????
},
{ 'id' => 'en:garlic-powder', 'text' => 'garlic powder' },
{ 'id' => 'en:aubergine', 'processing' => 'en:powdered', 'text' => 'eggplant' },
{ 'id' => 'en:courgette', 'processing' => 'en:powdered', 'text' => 'courgette' } ] ]
Error message
# Failed test at t/ingredients_processing.t line 143.
17060
- Structures begin differing at:
17061
- $got->[3]{text} = 'gehakte tomaten'
17062
- $expected->[3]{text} = 'tomaten'
17063