mirror of
				https://github.com/neovim/neovim.git
				synced 2025-11-04 01:34:25 +00:00 
			
		
		
		
	fix(buffer_updates): cleanup test behavior
This commit is contained in:
		@@ -349,12 +349,7 @@ describe('lua: nvim_buf_attach on_bytes', function()
 | 
				
			|||||||
      end
 | 
					      end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      local text = meths.buf_get_lines(0, 0, -1, true)
 | 
					      local text = meths.buf_get_lines(0, 0, -1, true)
 | 
				
			||||||
      local bytes = table.concat(text, '\n')
 | 
					      local bytes = table.concat(text, '\n') .. '\n'
 | 
				
			||||||
      if #text ~= 1 or #bytes ~= 0 then
 | 
					 | 
				
			||||||
        -- Not empty buffer.
 | 
					 | 
				
			||||||
        -- Append '\n' only if buffer is not empty, see nvim_buf_get_lines().
 | 
					 | 
				
			||||||
        bytes = bytes .. '\n'
 | 
					 | 
				
			||||||
      end
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
      eq(string.len(bytes), string.len(shadowbytes), '\non_bytes: total bytecount of buffer is wrong')
 | 
					      eq(string.len(bytes), string.len(shadowbytes), '\non_bytes: total bytecount of buffer is wrong')
 | 
				
			||||||
      for i = 1, string.len(shadowbytes) do
 | 
					      for i = 1, string.len(shadowbytes) do
 | 
				
			||||||
@@ -1094,17 +1089,17 @@ describe('lua: nvim_buf_attach on_bytes', function()
 | 
				
			|||||||
    end)
 | 
					    end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    local function test_lockmarks(mode)
 | 
					    local function test_lockmarks(mode)
 | 
				
			||||||
      if not mode then mode = "" end
 | 
					      local description = (mode ~= "") and mode or "(baseline)"
 | 
				
			||||||
      it("test_lockmarks " .. mode .. " %delete _", function()
 | 
					      it("test_lockmarks " .. description .. " %delete _", function()
 | 
				
			||||||
        local check_events = setup_eventcheck(verify, {"AAA", "BBB", "CCC"})
 | 
					        local check_events = setup_eventcheck(verify, {"AAA", "BBB", "CCC"})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        command(mode .. " %delete _")
 | 
					        command(mode .. " %delete _")
 | 
				
			||||||
        check_events {
 | 
					        check_events {
 | 
				
			||||||
          { "test1", "bytes", 1, 3, 0, 0, 0, 3, 0, 12, 0, 0, 0 };
 | 
					          { "test1", "bytes", 1, 3, 0, 0, 0, 3, 0, 12, 1, 0, 1 };
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      end)
 | 
					      end)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      it("test_lockmarks " .. mode .. " append()", function()
 | 
					      it("test_lockmarks " .. description .. " append()", function()
 | 
				
			||||||
        local check_events = setup_eventcheck(verify)
 | 
					        local check_events = setup_eventcheck(verify)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        command(mode .. " call append(0, 'CCC')")
 | 
					        command(mode .. " call append(0, 'CCC')")
 | 
				
			||||||
@@ -1131,7 +1126,8 @@ describe('lua: nvim_buf_attach on_bytes', function()
 | 
				
			|||||||
      end)
 | 
					      end)
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    test_lockmarks()
 | 
					    -- check that behavior is identical with and without "lockmarks"
 | 
				
			||||||
 | 
					    test_lockmarks ""
 | 
				
			||||||
    test_lockmarks "lockmarks"
 | 
					    test_lockmarks "lockmarks"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    teardown(function()
 | 
					    teardown(function()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user