Editing WikiDB/Tutorial: Creating your own data type

From TestWiki
Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 194: Line 194:
 
WikiDB provides a <code>&lt;guesstypes&gt;</code> tag which can be used to test how WikiDB will interpret an undefined field which has a given value (via the GetSimilarity action).  The contents of this tag is split into individual lines, which are interpreted as follows:
 
WikiDB provides a <code>&lt;guesstypes&gt;</code> tag which can be used to test how WikiDB will interpret an undefined field which has a given value (via the GetSimilarity action).  The contents of this tag is split into individual lines, which are interpreted as follows:
  
* If line starts with = then it is indicating what the expected result for the previous line is (useful for unit-testing).  If there is no previous line, it is ignored.  If it contains a colon, everything before the first colon is the expected type and everything after the first colon is the expected output.  The expected type may be left blank, which is the same as omitting it completely, except it allows you to supply an expected output that contains a colon.
+
* If line starts with = then it is indicating what the expected result for the previous line is (useful for unit-testing).  If there is no previous line, it is ignored.  If it contains a colon, everything before the first colon is the expected type and everything after the first colon is the expected output.  The expected type may be left blank, which is the same as omitting it completely, except it allows you to supply an expected output that contains a semi-colon.
 
* Otherwise, line is a new data definition line, which should have its type guessed.  Everything before the first colon is a label for the output, and the rest of the line is the value to be tested.
 
* Otherwise, line is a new data definition line, which should have its type guessed.  Everything before the first colon is a label for the output, and the rest of the line is the value to be tested.
  

Please note that all contributions to TestWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see TestWiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel | Editing help (opens in new window)