Skip to content

Commit

Permalink
pkg/nixcacheinfo: Add a few more tests to the splitOnce func (#19)
Browse files Browse the repository at this point in the history
@zimbatm added few more tests to my [pr
upstream](nix-community/go-nix#124), adding them
back here for consistency. Thanks @zimbatm!
  • Loading branch information
kalbasit authored Dec 4, 2024
1 parent abd5fa3 commit 7ab00a3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/nixcacheinfo/splitonce_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ func TestSplitOnce(t *testing.T) {
err string
}{
{"hello:world", ":", "hello", "world", ""},
{":helloworld", ":", "", "helloworld", ""},
{"helloworld:", ":", "helloworld", "", ""},
{"helloworld", ":", "", "", "found no separators in the string: separator=\":\" string=\"helloworld\""},
{"hello:wo:rld", ":", "", "", "found multiple separators in the string: separator=\":\" string=\"hello:wo:rld\""},
{"hello::world", ":", "", "", "found multiple separators in the string: separator=\":\" string=\"hello::world\""},
}

t.Parallel()
Expand Down

0 comments on commit 7ab00a3

Please sign in to comment.