FitNesse.NET
Scanner Test

scanner test

The leader and body are delimited by the tokens.
inputbasic [text] to [be] scanned
find token pair[]
checkleaderbasic
checkbodytext

The next token pair is found.
find token pair[]
checkleader to 
checkbodybe

The remaining input is returned when no more tokens are found.
find token pair[]
checkleader scanned
checkbody

Empty input returns empty results.
input
find token pair[]
checkleader
checkbody

Missing tokens returns empty body.
inputno first token]
find token pair[]
checkleaderno first token]
checkbody

inputno [second token
find token pair[]
checkleaderno [second token
checkbody

Out of order tokens returns empty body.
inputout ]of[ order
find token pair[]
checkleaderout ]of[ order
checkbody

Adjacent tokens are ignored.
inputscan [] this
find token pair[]
checkleaderscan [] this
checkbody

Empty leader is OK.
input[scan]
find token pair[]
checkleader
checkbodyscan

find token pair[]
checkleader
checkbody

Token body can be filtered.
input[not me] but [me]
find token pair[]filternot me
checkleader[not me] but
checkbodyme
© Copyright 2007,2008 Syterra Software Inc. All rights reserved.