-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
74 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
mmv1/third_party/terraform/services/dataproc/resource_dataproc_batch_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package dataproc | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestCloudDataprocBatchRuntimeConfigVersionDiffSuppress(t *testing.T) { | ||
cases := map[string]struct { | ||
Old, New string | ||
ExpectDiffSuppress bool | ||
}{ | ||
"old version is empty, new version has a value": { | ||
Old: "", | ||
New: "2.2.100", | ||
ExpectDiffSuppress: false, | ||
}, | ||
"old version is the prefix of the new version": { | ||
Old: "2.2", | ||
New: "2.2.100", | ||
ExpectDiffSuppress: true, | ||
}, | ||
"old version is not the prefix of the new version": { | ||
Old: "2.1", | ||
New: "2.2.100", | ||
ExpectDiffSuppress: false, | ||
}, | ||
"new version is empty, old version has a value": { | ||
Old: "2.2.100", | ||
New: "", | ||
ExpectDiffSuppress: false, | ||
}, | ||
"new version is the prefix of the old version": { | ||
Old: "2.2.100", | ||
New: "2.2", | ||
ExpectDiffSuppress: true, | ||
}, | ||
"new version is not the prefix of the old version": { | ||
Old: "2.2.100", | ||
New: "2.1", | ||
ExpectDiffSuppress: false, | ||
}, | ||
"old version is the same with the new version": { | ||
Old: "2.2.100", | ||
New: "2.2.100", | ||
ExpectDiffSuppress: true, | ||
}, | ||
"both new version and old version are empty string": { | ||
Old: "", | ||
New: "", | ||
ExpectDiffSuppress: true, | ||
}, | ||
} | ||
|
||
for tn, tc := range cases { | ||
if CloudDataprocBatchRuntimeConfigVersionDiffSuppressFunc(tc.Old, tc.New) != tc.ExpectDiffSuppress { | ||
t.Errorf("bad: %s, %q => %q expect DiffSuppress to return %t", tn, tc.Old, tc.New, tc.ExpectDiffSuppress) | ||
} | ||
} | ||
} |
27 changes: 0 additions & 27 deletions
27
mmv1/third_party/terraform/services/dataproc/resource_dataproc_batch_test.go.erb
This file was deleted.
Oops, something went wrong.