diff options
| -rw-r--r-- | .vimrc | 2 | ||||
| -rw-r--r-- | tests/json.lua | 10 | ||||
| -rw-r--r-- | tests/test.lua (renamed from tests/graphics.lua) | 16 |
3 files changed, 17 insertions, 11 deletions
@@ -2,7 +2,7 @@ set makeprg=make set errorformat=%f:%l:%c:\ %m let g:gdb_executable = 'bidi' -let g:gdb_arguments = '-f tests/graphics.lua' +let g:gdb_arguments = '-f tests/test.lua' nnoremap <leader>m :call LocalMake()<CR> nnoremap <leader>r :execute '!./' . g:gdb_executable . ' ' . g:gdb_arguments<CR> diff --git a/tests/json.lua b/tests/json.lua deleted file mode 100644 index a659889..0000000 --- a/tests/json.lua +++ /dev/null @@ -1,10 +0,0 @@ -local file = io.open("tests/test.json", "r") -local content = file:read("*a") -file:close() - -local data = json.decode(content) - -print("name: " .. data.name) -for _, n in pairs(data.numbers) do - print(" - number: " .. n) -end diff --git a/tests/graphics.lua b/tests/test.lua index 1322101..74bf797 100644 --- a/tests/graphics.lua +++ b/tests/test.lua @@ -32,6 +32,19 @@ function get_random_color() return color[randomKey] -- Return the corresponding color end +function test_json() + local file = io.open("tests/test.json", "r") + local content = file:read("*a") + file:close() + + local data = json.decode(content) + + print("name: " .. data.name) + for _, n in pairs(data.numbers) do + print(" - number: " .. n) + end +end + function test_buttons() -- Testing button presses. if button_down(button.PAD_UP) then @@ -110,6 +123,8 @@ function test_camera() -- Using camera move_camera(test_camera_position.x, test_camera_position.y) + draw_rect(100, 100, 300, 200, color.BLUE) + start_camera() draw_rect(0, 0, 300, 200, color.YELLOW) stop_camera() @@ -121,6 +136,7 @@ while window_running() do start_drawing() clear_window(color.BLACK) + -- test_json() -- test_api() -- test_buttons() -- test_camera() |
