GoCollections/lang/atomic/Reference_test.go
2023-04-16 14:57:20 +08:00

33 lines
544 B
Go

/*
* Copyright (c) 2022 tursom. All rights reserved.
* Use of this source code is governed by a GPL-3
* license that can be found in the LICENSE file.
*/
package atomic
import (
"testing"
)
func TestAtomic_Store(t *testing.T) {
//a := NewReference[int](nil)
//var i = 1
//a.Store(&i)
//i = 2
//fmt.Println(*a.Load())
}
func TestReferenceOf(t *testing.T) {
//one := 1
//
//var p *int = nil
//ref := ReferenceOf(&p)
//
//ref.Store(&one)
//fmt.Println(ref.Load())
//fmt.Println(*ref.Load())
//
//_ = *ref.AsUintptr() + 1
}