diff --git a/src/test/spec/json/uri-options/read-preference-options.json b/src/test/spec/json/uri-options/read-preference-options.json index e62ce4fa7..1158d224f 100644 --- a/src/test/spec/json/uri-options/read-preference-options.json +++ b/src/test/spec/json/uri-options/read-preference-options.json @@ -21,6 +21,36 @@ "maxStalenessSeconds": 120 } }, + { + "description": "Single readPreferenceTags is parsed as array of size one", + "uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:ny", + "valid": true, + "warning": false, + "hosts": null, + "auth": null, + "options": { + "readPreferenceTags": [ + { + "dc": "ny" + } + ] + } + }, + { + "description": "Read preference tags are case sensitive", + "uri": "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:NY", + "valid": true, + "warning": false, + "hosts": null, + "auth": null, + "options": { + "readPreferenceTags": [ + { + "dc": "NY" + } + ] + } + }, { "description": "Invalid readPreferenceTags causes a warning", "uri": "mongodb://example.com/?readPreferenceTags=invalid", @@ -28,7 +58,7 @@ "warning": true, "hosts": null, "auth": null, - "options": {} + "options": null }, { "description": "Non-numeric maxStalenessSeconds causes a warning", @@ -37,7 +67,7 @@ "warning": true, "hosts": null, "auth": null, - "options": {} + "options": null }, { "description": "Too low maxStalenessSeconds causes a warning", @@ -46,7 +76,7 @@ "warning": true, "hosts": null, "auth": null, - "options": {} + "options": null } ] -} +} \ No newline at end of file diff --git a/src/test/spec/json/uri-options/read-preference-options.yml b/src/test/spec/json/uri-options/read-preference-options.yml index f197a8b1f..465527497 100644 --- a/src/test/spec/json/uri-options/read-preference-options.yml +++ b/src/test/spec/json/uri-options/read-preference-options.yml @@ -9,12 +9,34 @@ tests: options: readPreference: "primaryPreferred" readPreferenceTags: - - + - dc: "ny" rack: "1" - dc: "ny" maxStalenessSeconds: 120 + - + description: "Single readPreferenceTags is parsed as array of size one" + uri: "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:ny" + valid: true + warning: false + hosts: ~ + auth: ~ + options: + readPreferenceTags: + - + dc: "ny" + - + description: "Read preference tags are case sensitive" + uri: "mongodb://example.com/?readPreference=secondary&readPreferenceTags=dc:NY" + valid: true + warning: false + hosts: ~ + auth: ~ + options: + readPreferenceTags: + - + dc: "NY" - description: "Invalid readPreferenceTags causes a warning" uri: "mongodb://example.com/?readPreferenceTags=invalid" @@ -22,7 +44,7 @@ tests: warning: true hosts: ~ auth: ~ - options: {} + options: ~ - description: "Non-numeric maxStalenessSeconds causes a warning" uri: "mongodb://example.com/?maxStalenessSeconds=invalid" @@ -30,7 +52,7 @@ tests: warning: true hosts: ~ auth: ~ - options: {} + options: ~ - description: "Too low maxStalenessSeconds causes a warning" uri: "mongodb://example.com/?maxStalenessSeconds=-2" @@ -38,5 +60,4 @@ tests: warning: true hosts: ~ auth: ~ - options: {} - + options: ~