diff options
author | 2020-03-25 15:09:42 -0400 | |
---|---|---|
committer | 2020-03-25 15:09:42 -0400 | |
commit | 52b0ec63792b3023b4ab42e42d2ce1e1fcb813bc (patch) | |
tree | df7de6501387d6a4edc2dc7326377533c7b72120 /test/test.lua | |
parent | d6217673792a247a086d1f7806ad670eef8e92ef (diff) | |
download | textadept-52b0ec63792b3023b4ab42e42d2ce1e1fcb813bc.tar.gz textadept-52b0ec63792b3023b4ab42e42d2ce1e1fcb813bc.zip |
Refactored buffer and view metamethods by splitting them up.
Grouping them saves a few lines of code, but it's not very maintainable.
Diffstat (limited to 'test/test.lua')
-rw-r--r-- | test/test.lua | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua index 6a7d9f0f..7f270fad 100644 --- a/test/test.lua +++ b/test/test.lua @@ -2939,6 +2939,14 @@ function test_view_split_resize_unsplit() assert_equal(#_VIEWS, 1) end +function test_buffer_read_write_only_properties() + assert_raises(function() buffer.all_lines_visible = false end, 'read-only property') + assert_raises(function() return buffer.auto_c_fill_ups end, 'write-only property') + assert_raises(function() buffer.annotation_text = {} end, 'read-only property') + assert_raises(function() buffer.char_at[POS(1)] = string.byte(' ') end, 'read-only property') + assert_raises(function() return buffer.marker_alpha[INDEX(1)] end, 'write-only property') +end + -- TODO: test init.lua's buffer settings -------------------------------------------------------------------------------- |