Copilot commented on code in PR #178:
URL: https://github.com/apache/iotdb-client-go/pull/178#discussion_r4003011294


##########
client/session_test.go:
##########
@@ -60,3 +63,35 @@ func TestParseNodeURL(t *testing.T) {
                })
        }
 }
+
+func TestBuildOpenSessionConfiguration(t *testing.T) {
+       cases := []struct {
+               name string
+               cfg  *Config
+               want map[string]string
+       }{
+               {
+                       name: "table dialect with db",
+                       cfg:  &Config{sqlDialect: TableSqlDialect, Database: 
"mydb"},
+                       want: map[string]string{"sql_dialect": TableSqlDialect, 
"version": string(DEFAULT_VERSION), "db": "mydb"},
+               },
+               {
+                       name: "tree dialect, no db (db key omitted)",
+                       cfg:  &Config{sqlDialect: TreeSqlDialect},
+                       want: map[string]string{"sql_dialect": TreeSqlDialect, 
"version": string(DEFAULT_VERSION)},
+               },
+               {
+                       name: "explicit version passes through",
+                       cfg:  &Config{sqlDialect: TableSqlDialect, Version: 
V_1_0},
+                       want: map[string]string{"sql_dialect": TableSqlDialect, 
"version": string(V_1_0)},

Review Comment:
   This “explicit version” case uses `V_1_0`, which is also `DEFAULT_VERSION`, 
so it still passes if the helper ignores `cfg.Version` and always takes the 
fallback branch. Use a non-default value such as `V_0_13` for both the input 
and expectation so the explicit-version path is actually covered.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to