vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

file-empty.lua

(325B)


      1 
      2 local file = vis.win.file
      3 
      4 describe("empty file", function()
      5 
      6 	it("has size zero", function()
      7 		assert.are.equal(0, file.size)
      8 	end)
      9 
     10 	it("has zero lines", function()
     11 		assert.are.equal(0, #file.lines)
     12 	end)
     13 
     14 	it("has lines[1] == ''", function()
     15 		-- is that what we want?
     16 		assert.are.equal("", file.lines[1])
     17 	end)
     18 
     19 end)
     20