@@ -32,7 +32,7 @@ func TestDisabled(t *testing.T) {
3232 if err != nil {
3333 t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
3434 }
35- db := DB {DB : mockDB , options : core.CommenterOptions {}}
35+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {}}
3636 query := "SELECT 2"
3737 if got , want := db .withComment (context .Background (), query ), query ; got != want {
3838 t .Errorf ("db.withComment(context.Background(), %q) = %q, want = %q" , query , got , want )
@@ -45,15 +45,15 @@ func TestHTTP_Net(t *testing.T) {
4545 t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
4646 }
4747
48- db := DB {DB : mockDB , options : core.CommenterOptions {EnableDBDriver : true , EnableRoute : true , EnableFramework : true }}
48+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableDBDriver : true , EnableRoute : true , EnableFramework : true }}
4949 r , err := http .NewRequest ("GET" , "hello/1" , nil )
5050 if err != nil {
5151 t .Errorf ("http.NewRequest('GET', 'hello/1', nil) returned unexpected error: %v" , err )
5252 }
5353
5454 ctx := core .ContextInject (r .Context (), httpnet .NewHTTPRequestExtractor (r , nil ))
5555 got := db .withComment (ctx , "Select 1" )
56- want := "Select 1/*driver=database%2Fsql,framework=net%2Fhttp,route=hello%2F1*/"
56+ want := "Select 1/*driver=database%2Fsql%3Amocksql ,framework=net%2Fhttp,route=hello%2F1*/"
5757 if got != want {
5858 t .Errorf ("db.withComment(ctx, 'Select 1') got %q, wanted %q" , got , want )
5959 }
@@ -65,9 +65,9 @@ func TestQueryWithSemicolon(t *testing.T) {
6565 t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
6666 }
6767
68- db := DB {DB : mockDB , options : core.CommenterOptions {EnableDBDriver : true }}
68+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableDBDriver : true }}
6969 got := db .withComment (context .Background (), "Select 1;" )
70- want := "Select 1/*driver=database%2Fsql*/;"
70+ want := "Select 1/*driver=database%2Fsql%3Amocksql */;"
7171 if got != want {
7272 t .Errorf ("db.withComment(context.Background(), 'Select 1;') got %q, wanted %q" , got , want )
7373 }
@@ -79,7 +79,7 @@ func TestOtelIntegration(t *testing.T) {
7979 t .Fatalf ("MockSQL failed with unexpected error: %s" , err )
8080 }
8181
82- db := DB {DB : mockDB , options : core.CommenterOptions {EnableTraceparent : true }}
82+ db := DB {DB : mockDB , driverName : "mocksql" , options : core.CommenterOptions {EnableTraceparent : true }}
8383 exp , _ := stdouttrace .New (stdouttrace .WithPrettyPrint ())
8484 bsp := sdktrace .NewSimpleSpanProcessor (exp ) // You should use batch span processor in prod
8585 tp := sdktrace .NewTracerProvider (
0 commit comments