MCPcopy Create free account
hub / github.com/TheAlgorithms/Go / getInterleavingTestCases

Function getInterleavingTestCases

dynamic/interleavingstrings_test.go:14–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12}
13
14func getInterleavingTestCases() []testCaseInterleaving {
15 return []testCaseInterleaving{
16 {"aab", "axy", "aaxaby", true}, // Valid interleaving
17 {"aab", "axy", "abaaxy", false}, // Invalid interleaving
18 {"", "", "", true}, // All empty strings
19 {"abc", "", "abc", true}, // Only s1 matches s3
20 {"", "xyz", "xyz", true}, // Only s2 matches s3
21 {"abc", "xyz", "abxcyz", true}, // Valid interleaving
22 {"aaa", "aaa", "aaaaaa", true}, // Identical strings
23 {"aaa", "aaa", "aaaaaaa", false}, // Extra character
24 {"abc", "def", "abcdef", true}, // Concatenation order
25 {"abc", "def", "adbcef", true}, // Valid mixed interleaving
26 }
27}
28
29func TestIsInterleave(t *testing.T) {
30 t.Run("Interleaving Strings test cases", func(t *testing.T) {

Callers 1

TestIsInterleaveFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected