anchor.diff:          |> Seq.map (snd >> Option.get)
           |> List.ofSeq
       test input expected
  +
  +[<Test>]
  +let ``Unrecognised then function definition``() =
  +    let unrecognisedLines =
  +        [
  +            (1, "hello")
  +            (2, "world")
  +        ]
  +        |> Seq.map
  +            (fun (ln, line) ->
  +                {   TopLevelFileLineNumber = ln
  +                    CurrentFileLineNumber = ln
  +                    CurrentFile = exampleFileName
  +                    Contents = Line(line) })
  +    let funcDefinitionLines =
  +        funcDefinition
  +        |> Seq.scan
  +            (fun (ln,_) line ->
  +                (ln,
  +                    Some
  +                        {
  +                            TopLevelFileLineNumber = ln
  +                            CurrentFileLineNumber = ln
  +                            CurrentFile = exampleFileName
  +                            Contents = Line(line) }))
  +            (3,None)
  +        |> Seq.skip 1
  +        |> Seq.map (snd >> Option.get)
  +    let firstLine, lastLine = funcDefinitionLines |> Seq.fold (fun (mn,mx) l -> (min mn l.CurrentFileLineNumber, max mx l.CurrentFileLineNumber)) (Int32.MaxValue, Int32.MinValue)
  +    test
  +        (Seq.append unrecognisedLines funcDefinitionLines)
  +        [
  +            {
  +                Category = CategorizationError
  +                Index = 0
  +                File = exampleFileName
  +                StartLine = 1
  +                EndLine = 2
  +                Lines = unrecognisedLines
  +            }
  +            {
  +                Category = FuncDefinition
  +                Index = 1
  +                File = exampleFileName
  +                StartLine = firstLine
  +                EndLine = lastLine
  +                Lines = funcDefinitionLines
  +            }
  +        ]
  +
  +[<Test>]
  +let ``Unrecognised then variable definition``() =
  +    let unrecognisedLines =
  +        [
  +            (1, "hello")
  +            (2, "world")
  +        ]
  +        |> Seq.map
  +            (fun (ln, line) ->
  +                {   TopLevelFileLineNumber = ln
  +                    CurrentFileLineNumber = ln
  +                    CurrentFile = exampleFileName
  +                    Contents = Line(line) })
  +    let varDefinitionLines =
  +        varDefinition
  +        |> Seq.scan
  +            (fun (ln,_) line ->
  +                (ln,
  +                    Some
  +                        {
  +                            TopLevelFileLineNumber = ln
  +                            CurrentFileLineNumber = ln
  +                            CurrentFile = exampleFileName
  +                            Contents = Line(line) }))
  +            (3,None)
  +        |> Seq.skip 1
  +        |> Seq.map (snd >> Option.get)
  +    let firstLine, lastLine = varDefinitionLines |> Seq.fold (fun (mn,mx) l -> (min mn l.CurrentFileLineNumber, max mx l.CurrentFileLineNumber)) (Int32.MaxValue, Int32.MinValue)
  +    test
  +        (Seq.append unrecognisedLines varDefinitionLines)
  +        [
  +            {
  +                Category = CategorizationError
  +                Index = 0
  +                File = exampleFileName
  +                StartLine = 1
  +                EndLine = 2
  +                Lines = unrecognisedLines
  +            }
  +            {
  +                Category = VarDefinition
  +                Index = 1
  +                File = exampleFileName
  +                StartLine = firstLine
  +                EndLine = lastLine
  +                Lines = varDefinitionLines
  +            }
  +        ]
  +
  +[<Test>]
  +let ``Unrecognised then attribute definition``() =
  +    let unrecognisedLines =
  +        [
  +            (1, "hello")
  +            (2, "world")
  +        ]
  +        |> Seq.map
  +            (fun (ln, line) ->
  +                {   TopLevelFileLineNumber = ln
  +                    CurrentFileLineNumber = ln
  +                    CurrentFile = exampleFileName
  +                    Contents = Line(line) })
  +    let attDefinitionLines =
  +        attDefinition
  +        |> Seq.scan
  +            (fun (ln,_) line ->
  +                (ln,
  +                    Some
  +                        {
  +                            TopLevelFileLineNumber = ln
  +                            CurrentFileLineNumber = ln
  +                            CurrentFile = exampleFileName
  +                            Contents = Line(line) }))
  +            (3,None)
  +        |> Seq.skip 1
  +        |> Seq.map (snd >> Option.get)
  +    let firstLine, lastLine = attDefinitionLines |> Seq.fold (fun (mn,mx) l -> (min mn l.CurrentFileLineNumber, max mx l.CurrentFileLineNumber)) (Int32.MaxValue, Int32.MinValue)
  +    test
  +        (Seq.append unrecognisedLines attDefinitionLines)
  +        [
  +            {
  +                Category = CategorizationError
  +                Index = 0
  +                File = exampleFileName
  +                StartLine = 1
  +                EndLine = 2
  +                Lines = unrecognisedLines
  +            }
  +            {
  +                Category = AttDefinition
  +                Index = 1
  +                File = exampleFileName
  +                StartLine = firstLine
  +                EndLine = lastLine
  +                Lines = attDefinitionLines
  +            }
  +        ]
  +
  +[<Test>]
  +let ``Unrecognised new file``() =
  +    let attDefinitionLines =
  +        attDefinition
  +        |> Seq.scan
  +            (fun (ln,_) line ->
  +                (ln,
  +                    Some
  +                        {
  +                            TopLevelFileLineNumber = ln
  +                            CurrentFileLineNumber = ln
  +                            CurrentFile = exampleFileName
  +                            Contents = Line(line) }))
  +            (1,None)
  +        |> Seq.skip 1
  +        |> Seq.map (snd >> Option.get)
  +    let firstLine, lastLine = attDefinitionLines |> Seq.fold (fun (mn,mx) l -> (min mn l.CurrentFileLineNumber, max mx l.CurrentFileLineNumber)) (Int32.MaxValue, Int32.MinValue)
  +    let unrecognisedLines =
  +        [
  +            (2, "hello")
  +            (3, "world")
  +        ]
  +        |> Seq.map
  +            (fun (ln, line) ->
  +                {   TopLevelFileLineNumber = ln
  +                    CurrentFileLineNumber = ln
  +                    CurrentFile = exampleFileName2
  +                    Contents = Line(line) })
  +    test
  +        (Seq.append attDefinitionLines unrecognisedLines)
  +        [
  +            {
  +                Category = AttDefinition
  +                Index = 0
  +                File = exampleFileName
  +                StartLine = firstLine
  +                EndLine = lastLine
  +                Lines = attDefinitionLines
  +            }
  +            {
  +                Category = CategorizationError
  +                Index = 1
  +                File = exampleFileName2
  +                StartLine = 2
  +                EndLine = 3
  +                Lines = unrecognisedLines
  +            }
  +        ]
  +
  +
  
positive.code:             {
                  Category = VarDefinition
                  Index = 0
                  File = "example.texton"
                  StartLine = firstLine1
                  EndLine = lastLine1
                  Lines = varDefinitionLines1
  
negative.code:         |> Option.map (fun (r,e) -> sprintf "\n%A\n\n!=\n\n%A" e r)
          |> Option.iter (fun s -> failwithf "The lists didn't match - first failing line was: %s" s)
  let exampleFileName = "example.texton"
  let exampleFileName2 = "example2.texton"
  
  [<Test>]
  let ``Categorize empty file``() =
  