fitSharp
Scanner Test

fit.Test.FitUnit.ScannerTest

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
checkbodyblank

Empty input returns empty results.
inputblank
find token pair[]
checkleaderblank
checkbodyblank

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

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

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

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

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

find token pair[]
checkleaderblank
checkbodyblank

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