github.com/mutagen-io/mutagen@v0.18.0-rc1/pkg/forwarding/version_test.go (about)

     1  package forwarding
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  // TestSupportedVersions verifies that session version support is as expected.
     8  func TestSupportedVersions(t *testing.T) {
     9  	// Set up test cases.
    10  	testCases := []struct {
    11  		version  Version
    12  		expected bool
    13  	}{
    14  		{Version_Invalid, false},
    15  		{Version_Version1, true},
    16  		{Version_Version1 + 1, false},
    17  	}
    18  
    19  	// Process test cases.
    20  	for _, testCase := range testCases {
    21  		if supported := testCase.version.Supported(); supported != testCase.expected {
    22  			t.Errorf(
    23  				"session version (%s) support does not match expected: %t != %t",
    24  				testCase.version,
    25  				supported,
    26  				testCase.expected,
    27  			)
    28  		}
    29  	}
    30  }