Go testing 패키지

Jmnote (토론 | 기여)님의 2023년 5월 27일 (토) 11:41 판

1 개요

Go testing 패키지
  • Go 표준 라이브러리의 하나
  • 자동 테스트를 지원하는 Go 패키지
  • 모든 기능 실행을 자동화하는 "go test" 명령과 함께 사용하기 위한 것이다.
package abs

import "testing"

func TestAbs(t *testing.T) {
    got := Abs(-1)
    if got != 1 {
        t.Errorf("Abs(-1) = %d; want 1", got)
    }
}

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}