         document.setInput({
           read: ->
             @_readIndex++
-            ["st", "u", "ff", "", ""][@_readIndex - 1]
+            [
+              "the", "-", "word",
+              " ",
+              "the", "-", "word",
+              ""
+            ][@_readIndex - 1]
 
           seek: (n) ->
             0

          _readIndex: 0,
        })

        assert.equal("(the_rule)", document.rootNode())

    describe "when the supplied object does not implement #seek(n)", ->
      it "throws an exception", ->

treeSitter = require "tree-sitter"
assert = require "assert"
compiler = require ".."
{ repeat } = compiler.rules

describe "Document", ->
  document = null

  language = compiler.compileAndLoad(compiler.grammar
    name: "test"
    rules:
      sentence: -> repeat(@word)
      word: -> "the-word"
  )

  beforeEach ->
    document = new treeSitter.Document()
