github.com/matrixorigin/matrixone@v1.2.0/pkg/pb/plugin/plugin_test.go (about)

     1  // Copyright 2021 - 2023 Matrix Origin
     2  //
     3  // Licensed under the Apache License, Version 2.0 (the "License");
     4  // you may not use this file except in compliance with the License.
     5  // You may obtain a copy of the License at
     6  //
     7  //      http://www.apache.org/licenses/LICENSE-2.0
     8  //
     9  // Unless required by applicable law or agreed to in writing, software
    10  // distributed under the License is distributed on an "AS IS" BASIS,
    11  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12  // See the License for the specific language governing permissions and
    13  // limitations under the License.
    14  
    15  package plugin
    16  
    17  import "testing"
    18  
    19  func TestRequest(t *testing.T) {
    20  	m := &Request{}
    21  	m.SetID(1)
    22  	if m.GetID() != 1 {
    23  		t.Errorf("Request.GetID() = %v, want %v", m.GetID(), 1)
    24  	}
    25  	if m.DebugString() != "1: <nil>/" {
    26  		t.Errorf("Request.DebugString() = %v, want %v", m.DebugString(), "1: <nil>/")
    27  	}
    28  }
    29  
    30  func TestResponse(t *testing.T) {
    31  	m := &Response{}
    32  	m.SetID(1)
    33  	if m.GetID() != 1 {
    34  		t.Errorf("Response.GetID() = %v, want %v", m.GetID(), 1)
    35  	}
    36  	if m.DebugString() != "1: <nil>/" {
    37  		t.Errorf("Response.DebugString() = %v, want %v", m.DebugString(), "1: <nil>/")
    38  	}
    39  }