(t *testing.T)
| 1084 | } |
| 1085 | |
| 1086 | func TestValidateMappingsValidFullRef(t *testing.T) { |
| 1087 | normalized, err := validation.ValidateMappings([]RefMapping{ |
| 1088 | {Source: "refs/heads/main", Target: "refs/heads/upstream-main"}, |
| 1089 | }, false) |
| 1090 | if err != nil { |
| 1091 | t.Fatalf("unexpected error: %v", err) |
| 1092 | } |
| 1093 | if len(normalized) != 1 { |
| 1094 | t.Fatalf("expected 1 normalized mapping, got %d", len(normalized)) |
| 1095 | } |
| 1096 | nm := normalized[0] |
| 1097 | if nm.SourceRef != "refs/heads/main" { |
| 1098 | t.Fatalf("expected source ref refs/heads/main, got %s", nm.SourceRef) |
| 1099 | } |
| 1100 | if nm.TargetRef != "refs/heads/upstream-main" { |
| 1101 | t.Fatalf("expected target ref refs/heads/upstream-main, got %s", nm.TargetRef) |
| 1102 | } |
| 1103 | } |
| 1104 | |
| 1105 | func TestBuildDesiredRefsEmptySource(t *testing.T) { |
| 1106 | // Empty source ref map with a branch filter: SelectBranches finds nothing, |
nothing calls this directly
no test coverage detected