github.com/zxy12/go_duplicate_112_new@v0.0.0-20200807091221-747231827200/src/os/user/cgo_unix_test.go (about)

     1  // Copyright 2017 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  // +build darwin dragonfly freebsd !android,linux netbsd openbsd solaris
     6  // +build cgo,!osusergo
     7  
     8  package user
     9  
    10  import (
    11  	"testing"
    12  )
    13  
    14  // Issue 22739
    15  func TestNegativeUid(t *testing.T) {
    16  	sp := structPasswdForNegativeTest()
    17  	u := buildUser(&sp)
    18  	if g, w := u.Uid, "4294967294"; g != w {
    19  		t.Errorf("Uid = %q; want %q", g, w)
    20  	}
    21  	if g, w := u.Gid, "4294967293"; g != w {
    22  		t.Errorf("Gid = %q; want %q", g, w)
    23  	}
    24  }