status-go/protocol/common
Eng Zer Jun 83ad76637a
test: use `T.TempDir` to create temporary test directory (#2746)
This commit replaces `os.MkdirTemp` with `t.TempDir` in tests. The
directory created by `t.TempDir` is automatically removed when the test
and all its subtests complete.

Prior to this commit, temporary directory created using `os.MkdirTemp`
needs to be removed manually by calling `os.RemoveAll`, which is omitted
in some tests. The error handling boilerplate e.g.
	defer func() {
		if err := os.RemoveAll(dir); err != nil {
			t.Fatal(err)
		}
	}
is also tedious, but `t.TempDir` handles this for us nicely.

Reference: https://pkg.go.dev/testing#T.TempDir

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-26 21:39:51 +01:00
..
chat_entity.go Skip wrapping emojis in private group chats 2021-01-26 09:39:47 +01:00
crypto.go Added device name set on Messenger.Start() 2022-11-25 11:33:58 +00:00
crypto_test.go Added device name set on Messenger.Start() 2022-11-25 11:33:58 +00:00
errors.go Use ErrRecordNotFound instead of sql.ErrNoRows 2020-10-08 13:23:00 +02:00
feature_flags.go feat: desktop mailserver cycle (#2481) 2022-01-12 12:02:01 -04:00
message.go Fix some issues with pinned messages 2023-04-25 16:02:48 +01:00
message_sender.go fix: fix special messages not being received because not encrypted 2022-12-15 10:48:41 -05:00
message_sender_test.go test: use `T.TempDir` to create temporary test directory (#2746) 2023-04-26 21:39:51 +01:00
message_test.go Compute emojiHash on-the-fly 2023-03-06 13:22:40 +02:00
pin_message.go Fix some issues with pinned messages 2023-04-25 16:02:48 +01:00
raw_message.go feat: mark automatic status updates as ephemeral 2022-11-09 15:49:26 +03:00
raw_messages_persistence.go Send all encryption keys 2022-10-20 12:19:44 +01:00
timesource.go Handle organisation membership requests 2020-12-23 17:20:55 +01:00