aboutsummaryrefslogtreecommitdiffstats
path: root/modules/util/util_test.go
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2023-07-07 07:31:56 +0200
committerGitHub <noreply@github.com>2023-07-07 05:31:56 +0000
commit8995046110147ae2c8c98be4e0a8c0b643ccc29c (patch)
tree94a3007199687c0a68eee5889af1619f1eebaf61 /modules/util/util_test.go
parentb1eb1676aa95d776ff9085002641ad62e040cd93 (diff)
downloadgitea-8995046110147ae2c8c98be4e0a8c0b643ccc29c.tar.gz
gitea-8995046110147ae2c8c98be4e0a8c0b643ccc29c.zip
Less naked returns (#25713)
just a step towards #25655 and some related refactoring
Diffstat (limited to 'modules/util/util_test.go')
-rw-r--r--modules/util/util_test.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/util/util_test.go b/modules/util/util_test.go
index 8cceafa2f6..c5830ce01c 100644
--- a/modules/util/util_test.go
+++ b/modules/util/util_test.go
@@ -224,3 +224,12 @@ func TestToTitleCase(t *testing.T) {
assert.Equal(t, ToTitleCase(`foo bar baz`), `Foo Bar Baz`)
assert.Equal(t, ToTitleCase(`FOO BAR BAZ`), `Foo Bar Baz`)
}
+
+func TestToPointer(t *testing.T) {
+ assert.Equal(t, "abc", *ToPointer("abc"))
+ assert.Equal(t, 123, *ToPointer(123))
+ abc := "abc"
+ assert.False(t, &abc == ToPointer(abc))
+ val123 := 123
+ assert.False(t, &val123 == ToPointer(val123))
+}