-
Notifications
You must be signed in to change notification settings - Fork 79
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
50 changed files
with
245 additions
and
182 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
Large diffs are not rendered by default.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ func Test_preMarshalConfig(t *testing.T) { | |
Simple1 *string `cass-config:"*:foo/simple1"` | ||
Simple2 bool `cass-config:"*:foo/simple2"` | ||
SimpleDSE *bool `cass-config:"[email protected]:foo/simple/dse"` | ||
SimpleHCD *bool `cass-config:"[email protected]:foo/simple/hcd"` | ||
} | ||
type komplex struct { | ||
ManyRestrictions *string `cass-config:"^3.11.x:foo/many-restrictions-3x;cassandra@>=4.x:foo/many-restrictions-4x"` | ||
|
@@ -31,6 +32,10 @@ func Test_preMarshalConfig(t *testing.T) { | |
ManyRestrictionsDSE *string `cass-config:">=4.x:many-restrictions-cassandra;dse@>=6.8.x:many-restrictions-dse"` | ||
ChildRecurseDSE *simple `cass-config:"dse@*:parent/;recurse"` | ||
} | ||
type hcd struct { | ||
ManyRestrictionsHCD *string `cass-config:">=4.x:many-restrictions-cassandra;dse@>=6.8.x:many-restrictions-dse;hcd@>=1.x.x:many-restrictions-hcd"` | ||
ChildRecurseHCD *simple `cass-config:"hcd@*:parent/;recurse"` | ||
} | ||
type invalid1 struct { | ||
Field1 string `cass-config:"dse@*:path:invalid tag"` | ||
} | ||
|
@@ -118,6 +123,14 @@ func Test_preMarshalConfig(t *testing.T) { | |
map[string]interface{}{"foo": map[string]interface{}{"simple": map[string]interface{}{"dse": ptr.To(true)}}}, | ||
assert.NoError, | ||
}, | ||
{ | ||
"simple HCD", | ||
reflect.ValueOf(&simple{SimpleHCD: ptr.To(true)}), | ||
semver.MustParse("1.0.0"), | ||
"hcd", | ||
map[string]interface{}{"foo": map[string]interface{}{"simple": map[string]interface{}{"hcd": ptr.To(true)}}}, | ||
assert.NoError, | ||
}, | ||
{ | ||
"simple server type mismatch", | ||
reflect.ValueOf(&simple{SimpleDSE: ptr.To(true)}), | ||
|
@@ -236,6 +249,28 @@ func Test_preMarshalConfig(t *testing.T) { | |
}, | ||
assert.NoError, | ||
}, | ||
{ | ||
"complex HCD 1.0", | ||
reflect.ValueOf(&hcd{ | ||
ManyRestrictionsHCD: ptr.To("qix"), | ||
ChildRecurseHCD: &simple{ | ||
SimpleHCD: ptr.To(true), | ||
}, | ||
}), | ||
semver.MustParse("1.0.0"), | ||
"hcd", | ||
map[string]interface{}{ | ||
"many-restrictions-hcd": ptr.To("qix"), | ||
"parent": map[string]interface{}{ | ||
"foo": map[string]interface{}{ | ||
"simple": map[string]interface{}{ | ||
"hcd": ptr.To(true), | ||
}, | ||
}, | ||
}, | ||
}, | ||
assert.NoError, | ||
}, | ||
{ | ||
"complex DSE 6.8 with cassandra server type", | ||
reflect.ValueOf(&dse{ | ||
|
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
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
Oops, something went wrong.