github.com/ebitengine/purego@v0.8.0-alpha.2.0.20240512170805-6cd12240d332/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/ebitengine/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  }