Revert "sync develop with main (#119)"

This reverts commit 76e817b5e1.
This commit is contained in:
Oleksandr Smirnov 2025-08-30 16:55:31 +03:00 committed by GitHub
parent 76e817b5e1
commit f23cb97d1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
37 changed files with 188 additions and 472 deletions

View file

@ -1,22 +0,0 @@
local t = require "spec.testutils"
local _, T, config = t.setup "config"
config["can be called without any arguments passed"] = function()
---@diagnostic disable-next-line: missing-parameter
require("gopher").setup()
end
config["can be called with empty table"] = function()
require("gopher").setup {}
end
config["should change option"] = function()
local log_level = 1234567890
require("gopher").setup {
log_level = log_level,
}
t.eq(log_level, require("gopher.config").log_level)
end
return T

View file

@ -1,14 +1,14 @@
local t = require "spec.testutils"
local _, T, utils = t.setup "utils"
local _, T = t.setup "utils"
utils["should .remove_empty_lines()"] = function()
T["utils"]["should .remove_empty_lines()"] = function()
local u = require "gopher._utils"
local inp = { "hi", "", "a", "", "", "asdf" }
t.eq(u.remove_empty_lines(inp), { "hi", "a", "asdf" })
end
utils["should .readfile_joined()"] = function()
T["utils"]["should .readfile_joined()"] = function()
local data = "line1\nline2\nline3"
local tmp = t.tmpfile()
local u = require "gopher._utils"
@ -17,7 +17,7 @@ utils["should .readfile_joined()"] = function()
t.eq(u.readfile_joined(tmp), data)
end
utils["should .trimend()"] = function()
T["utils"]["should .trimend()"] = function()
local u = require "gopher._utils"
t.eq(u.trimend " hi ", " hi")
end