[🤖] Add Unit-Tests
Build Docker and Deploy / Run goext test-suite (push) Successful in 1m34s

This commit is contained in:
2026-04-27 10:46:08 +02:00
parent dad0e3240d
commit 02d6894ec6
116 changed files with 18795 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
package langext
import (
"git.blackforestbytes.com/BlackForestBytes/goext/tst"
"os"
"path/filepath"
"testing"
)
func TestFileExistsTrue(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "f.txt")
if err := os.WriteFile(path, []byte("hi"), 0o644); err != nil {
t.Fatalf("setup failed: %v", err)
}
tst.AssertEqual(t, FileExists(path), true)
}
func TestFileExistsFalse(t *testing.T) {
dir := t.TempDir()
path := filepath.Join(dir, "missing.txt")
tst.AssertEqual(t, FileExists(path), false)
}
func TestFileExistsDirectoryReturnsFalse(t *testing.T) {
dir := t.TempDir()
tst.AssertEqual(t, FileExists(dir), false)
}