go/string_example_test.go
Snider 8b905f3a4a feat: per-file example tests — action, registry, fs, api, string, path, service, error, array
33 new examples across 8 dedicated files. Removed phantom CleanPath
(in RFC spec but never implemented — spec drift caught by examples).

545 tests total, 84.8% coverage. Every major primitive has compilable
examples that serve as test, documentation seed, and godoc content.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-25 18:29:24 +00:00

36 lines
607 B
Go

package core_test
import (
"fmt"
. "dappco.re/go/core"
)
func ExampleContains() {
fmt.Println(Contains("hello world", "world"))
fmt.Println(Contains("hello world", "mars"))
// Output:
// true
// false
}
func ExampleSplit() {
parts := Split("deploy/to/homelab", "/")
fmt.Println(parts)
// Output: [deploy to homelab]
}
func ExampleJoin() {
fmt.Println(Join("/", "deploy", "to", "homelab"))
// Output: deploy/to/homelab
}
func ExampleConcat() {
fmt.Println(Concat("hello", " ", "world"))
// Output: hello world
}
func ExampleTrim() {
fmt.Println(Trim(" spaced "))
// Output: spaced
}