Difference between revisions of "WikiDB/Data type unit tests"
From TestWiki
< WikiDB
(Added the unit tests from my dev wiki, so they are publicly visible) |
(Changed Example.jpg to an image that actually exists, to give more meaningful output. Also updated image: to file: for the direct image link, to reflect what it should be.) |
||
Line 61: | Line 61: | ||
Link to main namespace: [[Main Page]] | Link to main namespace: [[Main Page]] | ||
=Link:[[Main Page]] | =Link:[[Main Page]] | ||
− | Image: [[Image: | + | Image: [[Image:WikiDB icon.png]] |
− | =IMAGE:[[ | + | =IMAGE:[[File:WikiDB icon.png|75px]] |
− | Link to image: [[:Image: | + | Link to image: [[:Image:WikiDB icon.png]] |
− | =link:[[:Image: | + | =link:[[:Image:WikiDB icon.png]] |
Category: [[category:New category]] | Category: [[category:New category]] | ||
=link:[[:category:New category]] | =link:[[:category:New category]] |
Revision as of 01:29, 5 September 2012
This page is for unit-testing the GuessType() function, and the FormatAsType() function. WikiDB provides a <guesstypes>
tag to enable this testing. This page is not intended for public consumption, but for my own internal testing, however feel free to snoop.
Strings
Description | Original value | Type | Typed value | Formatted for sorting Spaces are currently collapsed, for ease of reading. Check source for full string. |
||
---|---|---|---|---|---|---|
Unrendered | Rendered | Unrendered | Rendered | |||
Empty string | wikistring | [ ] |
||||
Basic text | I want to be a lumberjack! | I want to be a lumberjack! | wikistring | I want to be a lumberjack! | I want to be a lumberjack! | [I want to be a lumberjack! ] |
Numbers
Description | Original value | Type | Typed value | Formatted for sorting Spaces are currently collapsed, for ease of reading. Check source for full string. |
||
---|---|---|---|---|---|---|
Unrendered | Rendered | Unrendered | Rendered | |||
Zero | 0 | 0 | integer | 0 | 0 | [ p 0.0 ] |
Integer | 34 | 34 | integer | 34 | 34 | [ p 34.0 ] |
Negative integer | -21 | -21 | integer | -21 | -21 | [ n 21.0 ] |
Real number | 5.0 | 5.0 | number | 5.0 | 5.0 | [ p 5.0 ] |
Longer real number | 1245.32452 | 1245.32452 | number | 1,245.32452 | 1,245.32452 | [ p 1245.32452 ] |
Zero as real number | 0.0 | 0.0 | number | 0.0 | 0.0 | [ p 0.0 ] |
Negative real number | -2343.981 | -2343.981 | number | -2,343.981 | -2,343.981 | [ n 2343.981 ] |
Real number without integer component | .43 | .43 | number | 0.43 | 0.43 | [ p 0.43 ] |
Real number without decimal component | 3. | 3. | wikistring | 3. | 3. | [3. ] |
Number with more than one decimal point | 1.2.3 | 1.2.3 | wikistring | 1.2.3 | 1.2.3 | [1.2.3 ] |
String followed by number | catch 22 | catch 22 | wikistring | catch 22 | catch 22 | [catch 22 ] |
Number followed by string | 39 steps | 39 steps | wikistring | 39 steps | 39 steps | [39 steps ] |
Number wrapped in text | measure 4 measure | measure 4 measure | wikistring | measure 4 measure | measure 4 measure | [measure 4 measure ] |
Numbers separated by spaces | 1 2 3 | 1 2 3 | wikistring | 1 2 3 | 1 2 3 | [1 2 3 ] |
Numbers separated by commas | 1,2,3 | 1,2,3 | wikistring | 1,2,3 | 1,2,3 | [1,2,3 ] |
Leading zeros | 0005.4 | 0005.4 | number | 5.4 | 5.4 | [ p 5.4 ] |
Leading zeros (integer) | 00035 | 00035 | integer | 35 | 35 | [ p 35.0 ] |
Trailing zeros | 34.350000 | 34.350000 | number | 34.35 | 34.35 | [ p 34.35 ] |
Leading & traling | 00009938.43800000 | 00009938.43800000 | number | 9,938.438 | 9,938.438 | [ p 9938.438 ] |
Example from documentation #1 | 808 | 808 | integer | 808 | 808 | [ p 808.0 ] |
Example from documentation #2 | 808 State | 808 State | wikistring | 808 State | 808 State | [808 State ] |
Links
Description | Original value | Type | Typed value | Formatted for sorting Spaces are currently collapsed, for ease of reading. Check source for full string. |
||
---|---|---|---|---|---|---|
Unrendered | Rendered | Unrendered | Rendered | |||
Wiki link without brackets | Help:About | Help:About | wikistring | Help:About | Help:About | [Help:About ] |
Link to main namespace | [[Main Page]] | Main Page | link | [[Main Page]] | Main Page | [Main_Page ] |
Image | [[Image:WikiDB icon.png]] | image | [[File:WikiDB_icon.png|75px|]] | [File:WikiDB_icon.png ] |
||
Link to image | [[:Image:WikiDB icon.png]] | Image:WikiDB icon.png | link | [[:Image:WikiDB icon.png]] | Image:WikiDB icon.png | [File:WikiDB_icon.png ] |
Category | [[category:New category]] | link | [[:category:New category]] | category:New category | [Category:New_category ] |
|
Link to category | [[:category:New category]] | category:New category | link | [[:category:New category]] | category:New category | [Category:New_category ] |
Link to template namespace | [[Template:New template]] | Template:New template | link | [[Template:New template]] | Template:New template | [Template:New_template ] |
Link to mediawiki namespace | [[MediaWiki:mainpage]] | MediaWiki:mainpage | link | [[MediaWiki:mainpage]] | MediaWiki:mainpage | [MediaWiki:Mainpage ] |
Link with pipe | [[Main Page|link to the main page]] | link to the main page | link | [[Main Page|link to the main page]] | link to the main page | [Main_Page ] |
URL without tags | http://www.kennel17.co.uk | http://www.kennel17.co.uk | wikistring | http://www.kennel17.co.uk | http://www.kennel17.co.uk | [http://www.kennel17.co.uk ] |
URL in tags | [http://www.kennel17.co.uk] | [1] | wikistring | [http://www.kennel17.co.uk] | [2] | [[http://www.kennel17.co.uk] ] |
URL with description | [http://www.kennel17.co.uk Kennel 17] | Kennel 17 | wikistring | [http://www.kennel17.co.uk Kennel 17] | Kennel 17 | [[http://www.kennel17.co.uk Kennel 17] ] |