Source file src/cmd/internal/osinfo/version_unix_test.go

     1  // Copyright 2024 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build unix
     6  
     7  package osinfo
     8  
     9  import (
    10  	"strings"
    11  	"testing"
    12  )
    13  
    14  func TestVersion(t *testing.T) {
    15  	v, err := Version()
    16  	if err != nil {
    17  		t.Fatal(err)
    18  	}
    19  
    20  	t.Logf("%q", v)
    21  
    22  	fields := strings.Fields(v)
    23  	if len(fields) < 4 {
    24  		t.Errorf("wanted at least 4 fields in %q, got %d", v, len(fields))
    25  	}
    26  }
    27  

View as plain text