...

Source file src/runtime/syscall_unix_test.go

Documentation: runtime

     1  // Copyright 2022 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 runtime_test
     8  
     9  import (
    10  	"runtime"
    11  	"syscall"
    12  	"testing"
    13  )
    14  
    15  func TestSyscallFlagAlignment(t *testing.T) {
    16  	// TODO(mknyszek): Check other flags.
    17  	check := func(name string, got, want int) {
    18  		if got != want {
    19  			t.Errorf("flag %s does not line up: got %d, want %d", name, got, want)
    20  		}
    21  	}
    22  	check("O_WRONLY", runtime.O_WRONLY, syscall.O_WRONLY)
    23  	check("O_CREAT", runtime.O_CREAT, syscall.O_CREAT)
    24  	check("O_TRUNC", runtime.O_TRUNC, syscall.O_TRUNC)
    25  }
    26  

View as plain text