2009-10-03 11:37:12 -06:00
|
|
|
// Copyright 2009 The Go Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
2010-07-14 18:17:53 -06:00
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
"stdio"
|
|
|
|
)
|
2009-10-03 11:37:12 -06:00
|
|
|
|
|
|
|
func main() {
|
2010-07-14 18:17:53 -06:00
|
|
|
stdio.Stdout.WriteString(stdio.Greeting + "\n")
|
|
|
|
|
|
|
|
l := stdio.Atol("123")
|
|
|
|
if l != 123 {
|
|
|
|
println("Atol 123: ", l)
|
|
|
|
panic("bad atol")
|
|
|
|
}
|
|
|
|
|
|
|
|
n, err := stdio.Strtol("asdf", 123)
|
|
|
|
if n != 0 || err != os.EINVAL {
|
|
|
|
println("Strtol: ", n, err)
|
|
|
|
panic("bad atoi2")
|
|
|
|
}
|
|
|
|
|
|
|
|
stdio.TestAlign()
|
|
|
|
stdio.TestEnum()
|
2009-10-03 11:37:12 -06:00
|
|
|
}
|