cgo_unix_test.go 595 B

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