Changes

Jump to navigation Jump to search
2,097 bytes added ,  11:08, 23 March 2020
Line 1: Line 1: −
[ { lc => "en", ingredients_text => "raw milk, sliced tomatoes, garlic powder, powdered eggplant, courgette powder"},  
+
<small>[[Processing Taxonomy|< Processing Taxonomy]]</small>
[
+
 
  {
+
All tests follow the same structure. There is one test set per language. For each process adjective there is a separate test. And a test consists of a string and the required results (ingredient and process).
    'id' => 'en:raw-milk',
+
 
    'text' => 'raw milk'
+
== Template ==
  },
+
The template for processing adjectives tests:
  {
+
 
    'id' => 'en:tomato',
+
  [ {  
    'processing' => 'en:sliced',
+
Define the language for which the tests are applicable.
    'text' => 'tomatoes'
+
  lc => "en",
  },
+
Define in the ingredients_text the original ingredients 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" },
    'id' => 'en:garlic-powder',
+
 
    'text' => 'garlic 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',
 
     'id' => 'en:aubergine',
Line 19: Line 37:  
     'text' => 'eggplant'
 
     'text' => 'eggplant'
 
   },
 
   },
 +
 
   {
 
   {
 
     'id' => 'en:courgette',
 
     'id' => 'en:courgette',
 
     'processing' => 'en:powdered',
 
     'processing' => 'en:powdered',
 
     'text' => 'courgette'
 
     'text' => 'courgette'
   }
+
  }
]
+
  ] ]
 +
== Error message ==
 +
An error message for the '''text''' field might be:
 +
  #  Failed test at t/ingredients_processing.t line 143.
 +
  #    Structures begin differing at:
 +
  #          $got->[3]{text} = 'gehakte tomaten'
 +
  #    $expected->[3]{text} = 'tomaten'
 +
This should be read as: replace ''gehakte tomaten'' with ''tomaten'' in the test
 +
 
 +
To test the ingredient ''gemalen kokos'', we get:
 +
#   Failed test at ../t/ingredients_processing.t line 143.
 +
#    Structures begin differing at:
 +
#          $got->[3]{processing} = Does not exist
 +
#    $expected->[3]{processing} = 'en:ground'
 +
The test failed here as ''gemalen kokos'' is already in the ingredients taxonomy. We need to test with an ingredient that is not in the ingredients taxonomy. "gemalen XYZ" should not be in the ingredients taxonomy, but "XYZ" should be. (otherwise we won't match)
   −
]
+
So the '''got''' is what you specified in the test and the '''expected''' is what the app calculated.
3,390

edits

Navigation menu