github.com/jwijenbergh/purego@v0.0.0-20240126093400-70ff3a61df13/syscall_test.go (about)

     1  // SPDX-License-Identifier: Apache-2.0
     2  // SPDX-FileCopyrightText: 2023 The Ebitengine Authors
     3  
     4  package purego_test
     5  
     6  import (
     7  	"os"
     8  	"testing"
     9  
    10  	_ "github.com/jwijenbergh/purego"
    11  )
    12  
    13  func TestOS(t *testing.T) {
    14  	// set and unset an environment variable since this calls into fakecgo.
    15  	err := os.Setenv("TESTING", "SOMETHING")
    16  	if err != nil {
    17  		t.Errorf("failed to Setenv: %s", err)
    18  	}
    19  	err = os.Unsetenv("TESTING")
    20  	if err != nil {
    21  		t.Errorf("failed to Unsetenv: %s", err)
    22  	}
    23  }