github.com/cellofellow/gopkg@v0.0.0-20140722061823-eec0544a62ad/apps/cgo/sum_test.go (about) 1 // Copyright 2014 <chaishushan{AT}gmail.com>. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package cgo 6 7 import ( 8 "testing" 9 ) 10 11 func TestSum(t *testing.T) { 12 if v := Sum([]int32{1, 2, 3, 4, 5}); v != 15 { 13 t.Fatalf("expect = %v. got = %v", 15, v) 14 } 15 }