unittest

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 19, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

unittest is a package full of many independent and small translation examples

unittest has two package comments

Index

Constants

View Source
const ConstWithAbbrevType also_u32 = 3
View Source
const ConstWithArith uint64 = 4 + 3*TypedInt
View Source
const Disk1 uint64 = 0
View Source
const Disk2 uint64 = 0
View Source
const DiskSize uint64 = 1000
View Source
const DivisionInConst uint64 = (4096 - 8) / 8
View Source
const GlobalConstant string = "foo"
View Source
const ModInConst uint64 = 513 + 12%8 // 517
View Source
const ModInConstParens uint64 = (513 + 12) % 8 // 5
View Source
const TypedInt uint64 = 32
View Source
const TypedInt32 uint32 = 3
View Source
const UntypedStringConstant = "bar" // an untyped string

Variables

This section is empty.

Functions

func ArithmeticShifts

func ArithmeticShifts(x uint32, y uint64) uint64

func AssignNilPointer

func AssignNilPointer()

func AssignNilSlice

func AssignNilSlice()

func AssignOps

func AssignOps()

func BitwiseOps

func BitwiseOps(x uint32, y uint64) uint64

func ComparePointerToNil

func ComparePointerToNil() bool

func CompareSliceToNil

func CompareSliceToNil() bool

func Comparison

func Comparison(x uint64, y uint64) bool

func DoNothing

func DoNothing()

func DoSomeLocking

func DoSomeLocking(l *sync.Mutex)

DoSomeLocking uses the entire lock API

func DoSomething

func DoSomething(s string)

DoSomething is an impure function

func ImplicitLoopContinue

func ImplicitLoopContinue()

func ImplicitLoopContinue2

func ImplicitLoopContinue2()

func ImplicitLoopContinueAfterIfBreak

func ImplicitLoopContinueAfterIfBreak(i uint64)

func IterateMapKeys

func IterateMapKeys(m map[uint64]uint64, sum *uint64)

func LogicalAndEqualityOperators

func LogicalAndEqualityOperators(b1 bool, x uint64) bool

func LogicalOperators

func LogicalOperators(b1 bool, b2 bool) bool

func MapSize

func MapSize(m map[uint64]bool) uint64

func MapTypeAliases

func MapTypeAliases(m1 map[IntWrapper]bool, m2 MapWrapper)

func Oracle

func Oracle()

func PanicAtTheDisco

func PanicAtTheDisco()

func ReassignVars

func ReassignVars()

func ReplicatedDiskRecover

func ReplicatedDiskRecover()

func ReplicatedDiskWrite

func ReplicatedDiskWrite(a uint64, v Block)

func Skip

func Skip()

Skip is a placeholder for some impure code

func StringMap

func StringMap(m map[string]uint64) uint64

func TakesFunctionType

func TakesFunctionType(f func())

func ToBeDebugged

func ToBeDebugged(x uint64) uint64

func TwoDiskLock

func TwoDiskLock(a uint64)

TwoDiskLock is a dummy function to represent locking an address in the base layer

func TwoDiskUnlock

func TwoDiskUnlock(a uint64)

TwoDiskUnlock is a dummy function to represent unlocking an address in the base layer

func TwoDiskWrite

func TwoDiskWrite(diskId uint64, a uint64, v Block) bool

TwoDiskWrite is a dummy function to represent the base layer's disk write

func TyMethodDriver

func TyMethodDriver()

Test both ptr and direct receiver methods since there's a tricky corner case there.

func UseAdd

func UseAdd() uint64

func UseAddWithLiteral

func UseAddWithLiteral() uint64

Types

type A

type A struct {
}

type B

type B struct {
	// contains filtered or unexported fields
}

type Block

type Block struct {
	Value uint64
}

func ReplicatedDiskRead

func ReplicatedDiskRead(a uint64) Block

func TwoDiskRead

func TwoDiskRead(diskId uint64, a uint64) (Block, bool)

TwoDiskRead is a dummy function to represent the base layer's disk read

type Dec

type Dec struct {
	// contains filtered or unexported fields
}

func (*Dec) UInt32

func (d *Dec) UInt32() uint32

func (*Dec) UInt64

func (d *Dec) UInt64() uint64

type Enc

type Enc struct {
	// contains filtered or unexported fields
}

func (*Enc) UInt32

func (e *Enc) UInt32(x uint32)

func (*Enc) UInt64

func (e *Enc) UInt64(x uint64)

type IntWrapper

type IntWrapper uint64

type MapWrapper

type MapWrapper map[uint64]bool

type Point

type Point struct {
	// contains filtered or unexported fields
}

func (Point) Add

func (c Point) Add(z uint64) uint64

func (Point) GetField

func (c Point) GetField() uint64

type S

type S struct {
	// contains filtered or unexported fields
}

func NewS

func NewS() *S

type SliceAlias

type SliceAlias []bool

type Timestamp

type Timestamp uint64

type TwoInts

type TwoInts struct {
	// contains filtered or unexported fields
}

type TyMethodInt

type TyMethodInt uint64

type TyMethodSl

type TyMethodSl []byte

type UseNamedType

type UseNamedType Timestamp

type UseTypeAbbrev

type UseTypeAbbrev my_u64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL