func TestFindSubPatternWithLengthInvalid(t *testing.T) {
    data := findSubPattern("abcd", 3000)
    if data != -1 {
        t.Errorf("data = %d, want %d", data, -1)
    }
}
tests finding an invalid sub-pattern with a length specified
package overflow
import (
    "testing"
)
func TestFindSubPatternEmpty(t *testing.T) {
    data := findSubPattern("", 0)
    if data != -1 {
        t.Errorf("data = %d, want %d", data, -1)
    }
}
func TestFindSubPatternEmptyWithLength(t *testing.T) {
    data := findSubPattern("", 3000)
    if data != -1 {
        t.Errorf("data = %d, want %d", data, -1)
    }
}
func TestFindSubPatternSmallValid(t *testing.T) {
    data := findSubPattern("7Co8", 0)
    if data != 2003 {
        t.Errorf("data = %d, want %d", data, 2003)
    }
}
func TestFindSubPatternSmallWithLengthValid(t *testing.T) {
    data := findSubPattern("7Co8", 3000)
    if data != 2003 {
        t.Errorf("data = %d, want %d", data, 2003)
    }
}
func TestFindSubPatternInvalid(t *testing.T) {
    data := findSubPattern("abcd", 0)
    if data != -1 {
        t.Errorf("data = %d, want %d", data, -1)
    }
}