func TestFilterSuccess(t *testing.T) {

	// init cheatpaths
	paths := []Cheatpath{
		Cheatpath{Name: "foo"},
		Cheatpath{Name: "bar"},
		Cheatpath{Name: "baz"},
	}

	// filter the paths
	paths, err := Filter(paths, "bar")
	if err != nil {
		t.Errorf("failed to filter paths: %v", err)
	}

	// assert that the expected path was returned
	if len(paths) != 1 {
		t.Errorf(
			"failed to return correct path count: want: 1, got: %d",
			len(paths),
		)
	}

	if paths[0].Name != "bar" {
		t.Errorf("failed to return correct path: want: bar, got: %s", paths[0].Name)
	}
}
// TestFilterSuccess asserts that the proper cheatpath is returned when the
// requested cheatpath exists
TestFilterSuccess asserts that the proper cheatpath is returned when the
requested cheatpath exists
// TestFilterSuccess asserts that the proper cheatpath is returned when the // requested cheatpath exists
func TestFilterSuccess(t *testing.T) {
	paths := []Cheatpath{
		Cheatpath{Name: "foo"},
		Cheatpath{Name: "bar"},
		Cheatpath{Name: "baz"},
	}
	paths, err := Filter(paths, "bar")
	if err != nil {
		t.Errorf("failed to filter paths: %v", err)
	}
	if len(paths) != 1 {
		t.Errorf(
			"failed to return correct path count: want: 1, got: %d",
			len(paths),
		)
	}
	if paths[0].Name != "bar" {
		t.Errorf("failed to return correct path: want: bar, got: %s", paths[0].Name)
	}
}
func TestFilterSuccess ( t * testing . T ) { paths := [ ] Cheatpath { Cheatpath { Name : " " } , Cheatpath { Name : " " } , Cheatpath { Name : " " } , } paths , err := Filter ( paths , " " ) if err != nil { t . Errorf ( " " , err ) } if len ( paths ) != 1 { t . Errorf ( " " , len ( paths ) , ) } if paths [ 0 ] . Name != " " { t . Errorf ( " " , paths [ 0 ] . Name ) } }
TestFilterSuccess asserts that the proper cheatpath is returned when the
requested cheatpath exists
TestFilterSuccess asserts that the proper cheatpath is returned when the requested cheatpath exists
// init cheatpaths // filter the paths // assert that the expected path was returned