Mercurial > vim
comparison src/testdir/test_vim9_disassemble.vim @ 26739:47ad45fb433a v8.2.3898
patch 8.2.3898: Vim9: not sufficient testing for variable initialization
Commit: https://github.com/vim/vim/commit/fb9dcb080b5143d3021a8c1d6deaf143f2ca3a48
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Dec 25 22:00:49 2021 +0000
patch 8.2.3898: Vim9: not sufficient testing for variable initialization
Problem: Vim9: not sufficient testing for variable initialization.
Solution: Add another test case.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Dec 2021 23:15:03 +0100 |
parents | b969fdb8cd46 |
children | c2186e32ae42 |
comparison
equal
deleted
inserted
replaced
26738:6ced3f1bd976 | 26739:47ad45fb433a |
---|---|
1800 '\d\+ RETURN', | 1800 '\d\+ RETURN', |
1801 instr) | 1801 instr) |
1802 assert_equal(true, InvertBool()) | 1802 assert_equal(true, InvertBool()) |
1803 enddef | 1803 enddef |
1804 | 1804 |
1805 def AutoInit() | |
1806 var t: number | |
1807 t = 1 | |
1808 t = 0 | |
1809 enddef | |
1810 | |
1811 def Test_disassemble_auto_init() | |
1812 var instr = execute('disassemble AutoInit') | |
1813 assert_match('AutoInit\_s*' .. | |
1814 'var t: number\_s*' .. | |
1815 't = 1\_s*' .. | |
1816 '\d STORE 1 in $0\_s*' .. | |
1817 't = 0\_s*' .. | |
1818 '\d STORE 0 in $0\_s*' .. | |
1819 '\d\+ RETURN void', | |
1820 instr) | |
1821 enddef | |
1822 | |
1805 def Test_disassemble_compare() | 1823 def Test_disassemble_compare() |
1806 var cases = [ | 1824 var cases = [ |
1807 ['true == isFalse', 'COMPAREBOOL =='], | 1825 ['true == isFalse', 'COMPAREBOOL =='], |
1808 ['true != isFalse', 'COMPAREBOOL !='], | 1826 ['true != isFalse', 'COMPAREBOOL !='], |
1809 ['v:none == isNull', 'COMPARESPECIAL =='], | 1827 ['v:none == isNull', 'COMPARESPECIAL =='], |