summaryrefslogtreecommitdiff
path: root/tests/gobang.go
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-09-27 15:12:09 -0300
committerEuAndreh <eu@euandre.org>2024-09-27 15:12:09 -0300
commit02ed6178c764c5b0a5c71a265214abbce4538abe (patch)
tree0fe35c3c173a9caacf583728d196c897d5fcf5af /tests/gobang.go
parentsrc/gobang.go: Turn private sourceInfoSkip const into public SourceInfoSkip v... (diff)
downloadgobang-02ed6178c764c5b0a5c71a265214abbce4538abe.tar.gz
gobang-02ed6178c764c5b0a5c71a265214abbce4538abe.tar.xz
src/gobang.go: Add SQLiteNow const and ValidSQLTablePrefix()
Diffstat (limited to 'tests/gobang.go')
-rw-r--r--tests/gobang.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gobang.go b/tests/gobang.go
index 518748e..8d85933 100644
--- a/tests/gobang.go
+++ b/tests/gobang.go
@@ -13,6 +13,38 @@ import (
+func test_ValidSQLTablePrefix() {
+ TestStart("ValidSQLTablePrefix()")
+
+ Testing("simple identifiers are good", func() {
+ input := []string{
+ "simple",
+ "id",
+ "g00d",
+ "VERY_GOOD",
+ }
+
+ for _, given := range input {
+ AssertEqual(ValidSQLTablePrefix(given), true)
+ }
+ })
+
+ Testing("nothing fancy is allowed", func() {
+ input := []string{
+ "a-table",
+ "0t",
+ "",
+ "thing\"",
+ "*symbol",
+ "symbol*",
+ }
+
+ for _, given := range input {
+ AssertEqual(ValidSQLTablePrefix(given), false)
+ }
+ })
+}
+
func test_SomeError() {
TestStart("SomeError()")
@@ -926,6 +958,7 @@ func test_setHostname() {
func MainTest() {
+ test_ValidSQLTablePrefix()
test_SomeError()
test_SomeFnError()
test_Random()