forgejo/modules/util
wxiaoguang 3c4153b195
[PORT] Refactor tests to prevent from unnecessary preparations (gitea#32398)
Some preparations are only used by a few tests, so to make the tests fast, they should only be prepared when they are used.

By the way, this PR splits PrepareTestEnv into small functions to make it simple.

---

Conflict resolution: Mostly magical and just re-pasting the code into
the right places.
Done differently: use `require.NoError` instead of `assert.NoError`.

(cherry picked from commit ec2d1593c269e06655525deb96f74b8094221b6f)
2024-11-07 23:02:10 +01:00
..
filebuffer Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
rotatingfilewriter Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
color.go [PORT] gitea##30237: Fix and rewrite contrast color calculation, fix project-related bugs 2024-04-15 16:11:34 +02:00
color_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
error.go
file_unix.go
file_unix_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
io.go
io_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
keypair.go Enable unparam linter (#31277) 2024-06-16 13:42:58 +02:00
keypair_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
legacy.go [DEADCODE] Add deadcode linter 2024-02-05 14:45:09 +01:00
legacy_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
pack.go
pack_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
paginate.go
paginate_test.go
path.go Add codespell support and fix a good number of typos with its help (#3270) 2024-05-09 13:49:37 +00:00
path_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
remove.go
sanitize.go Refactor to use UnsafeStringToBytes (#31358) 2024-06-16 13:42:58 +02:00
sanitize_test.go
sec_to_time.go
sec_to_time_test.go
shellquote.go
shellquote_test.go
slice.go Performance improvements for pull request list page (#29900) 2024-03-26 19:04:26 +01:00
slice_test.go
string.go Refactor to use UnsafeStringToBytes (#31358) 2024-06-16 13:42:58 +02:00
string_test.go
timer.go
timer_test.go
truncate.go
truncate_test.go
url.go
util.go [PORT] Refactor tests to prevent from unnecessary preparations (gitea#32398) 2024-11-07 23:02:10 +01:00
util_test.go [PORT] Refactor tests to prevent from unnecessary preparations (gitea#32398) 2024-11-07 23:02:10 +01:00