From 585f04c74534325a5990fc07f4a535bfd20ee29b Mon Sep 17 00:00:00 2001 From: Squibid Date: Wed, 2 Jul 2025 03:53:31 -0400 Subject: [PATCH] add testing... this is very limited right now, but I will expand as I see fit --- Makefile | 4 ++++ tests/dep_spec.lua | 20 ++++++++++++++++++++ tests/minit.lua | 1 + 3 files changed, 25 insertions(+) create mode 100644 Makefile create mode 100644 tests/dep_spec.lua create mode 100644 tests/minit.lua diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..be555db --- /dev/null +++ b/Makefile @@ -0,0 +1,4 @@ +test: + nvim --headless -c "PlenaryBustedDirectory tests/ {minimal_init = './tests/minit.lua'}" + +.PHONY: test diff --git a/tests/dep_spec.lua b/tests/dep_spec.lua new file mode 100644 index 0000000..38d8e56 --- /dev/null +++ b/tests/dep_spec.lua @@ -0,0 +1,20 @@ +---@diagnostic disable: undefined-global, undefined-field +local dep_ui_format = require("dep.ui.format") + +describe("ui log formatting", function() + it("returns the proper chunks to print a formatted line", function() + assert.same( + { + { "[", "" }, + { "11:22:33", "Boolean" }, + { "] ", "" }, + { "file.lua", "String" }, + { ":", "" }, + { "1", "Number" }, + { ": ", "" }, + { "some fancy message", "" } + }, + dep_ui_format.log_line("[11:22:33] file.lua:1:(vim) some fancy message") + ) + end) +end) diff --git a/tests/minit.lua b/tests/minit.lua new file mode 100644 index 0000000..22d1049 --- /dev/null +++ b/tests/minit.lua @@ -0,0 +1 @@ +vim.opt.rtp:prepend(".")