Template talk:Test-case-query

From OLPC
Revision as of 02:10, 5 September 2008 by Sj (talk | contribs)
Jump to: navigation, search

Here we are hacking data we get back from SMW : it is returning the name of the test in question as a property, with standard format

 Property name

So we use the string functions provided by Extension:StringFunctions to extract the raw property name:

  1. find the length of the property-string S
  2. if the property name string is P, len(S) = 2len(P) + 5. so we extract the substring (len(P)+4, -2) to get P
  3. in the above, since we don't yet know P, we write this as (len(S) + 3)/2

Hopefully you don't have to try this at home. If you do, see [1] and [2]. --Sj talk 06:10, 5 September 2008 (UTC)