| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
package objcpkg |
| 6 |
|
| 7 |
import ( |
| 8 |
"ObjC/Foundation/NSDate" |
| 9 |
"ObjC/Foundation/NSString" |
| 10 |
"ObjC/QuartzCore/CAMediaTimingFunction" |
| 11 |
) |
| 12 |
|
| 13 |
func Func() { |
| 14 |
NSDate.Date() |
| 15 |
CAMediaTimingFunction.FunctionWithControlPoints(0, 0, 0, 0) |
| 16 |
} |
| 17 |
|
| 18 |
func Method() string { |
| 19 |
d := NSDate.Date() |
| 20 |
return d.Description() |
| 21 |
} |
| 22 |
|
| 23 |
func New() { |
| 24 |
NSDate.New() |
| 25 |
CAMediaTimingFunction.NewWithControlPoints(0, 0, 0, 0) |
| 26 |
} |
| 27 |
|
| 28 |
func Error() { |
| 29 |
str, err := NSString.StringWithContentsOfFileEncodingError("<non-existent>", 0) |
| 30 |
if err == nil { |
| 31 |
panic("no error from stringWithContentsOfFile") |
| 32 |
} |
| 33 |
|
| 34 |
err = err.(error) |
| 35 |
if str != "" { |
| 36 |
panic("non-empty string from stringWithContentsOfFile") |
| 37 |
} |
| 38 |
str, err = NSString.NewWithContentsOfFileEncodingError("<non-existent>", 0) |
| 39 |
if err == nil { |
| 40 |
panic("no error from stringWithContentsOfFile") |
| 41 |
} |
| 42 |
|
| 43 |
err = err.(error) |
| 44 |
if str != "" { |
| 45 |
panic("non-empty string from initWithContentsOfFile") |
| 46 |
} |
| 47 |
} |