Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How Go test tests
Search
Seiji Takahashi
December 11, 2017
Programming
2
6.6k
How Go test tests
Presentation for golang.tokyo #11
Seiji Takahashi
December 11, 2017
Tweet
Share
More Decks by Seiji Takahashi
See All by Seiji Takahashi
権限と承認 〜ユーザー信頼性に繋がる管理画面の根幹について〜
timakin
0
760
Go Backends for frontends with GraphQL and gRPC
timakin
6
4.2k
Design Pattern for Image and Text Composition in Go
timakin
5
6.8k
Golang API Testing the HARD way
timakin
13
6.9k
Head First Golang Image Package
timakin
2
10k
React Native Beyond Prototype
timakin
2
1.7k
Performance Optimization on Google AppEngine
timakin
5
6.5k
testcache.pdf
timakin
1
200
How Go cache
timakin
1
120
Other Decks in Programming
See All in Programming
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
110
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
120
Python’s True Superpower
hynek
0
190
Amazon Bedrockを活用したRAGの品質管理パイプライン構築
tosuri13
5
910
オブザーバビリティ駆動開発って実際どうなの?
yohfee
3
640
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3k
Railsの気持ちを考えながらコントローラとビューを整頓する/tidying-rails-controllers-and-views-as-rails-think
moro
4
360
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
350
米国のサイバーセキュリティタイムラインと見る Goの暗号パッケージの進化
tomtwinkle
1
360
あなたはユーザーではない #PdENight
kajitack
4
290
Rails Girls Tokyo 18th GMO Pepabo Sponsor Talk
yutokyokutyo
0
180
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
120
Featured
See All Featured
Designing Experiences People Love
moore
144
24k
Ethics towards AI in product and experience design
skipperchong
2
210
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
1
950
Between Models and Reality
mayunak
1
210
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
We Are The Robots
honzajavorek
0
190
sira's awesome portfolio website redesign presentation
elsirapls
0
170
Leo the Paperboy
mayatellez
4
1.5k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
0
220
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
140
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Transcript
How Go test tests @__timakin__
• Seiji Takahashi • Github: timakin / Twitter: @__timakin__ •
גࣜձࣾGunosy ৽نࣄۀ։ൃࣨ • Go / Swift ࣗݾհ
Copyright© Gunosy Inc. All Rights Reserved 3 Go / Python
ΤϯδχΞืूத ▶https://gunosy.co.jp/recruit/ Gunosyɺ౦ژେֶʹ௨͏3ਓͷֶੜͷ ʮใΛੈքதͷਓʹ࠷దʹಧ͚͍ͨʯͱ͍͏͍͔Β࢝·Γ·ͨ͠ɻ ౦ূϚβʔζ্ɺຊώϧζͷΦϑΟεҠసΛܦͯɺ େ͖͍ͯ͘͠ΔձࣾͰ׆༂͍ͨ͠ϝϯόʔΛืू͍ͯ͠·͢ɻ
Test of test
None
Go1.9~ ͕ؔͲΜͳग़ྗΛ͢Δͷ͔ɺ ExampleΛఆٛͰ͖ΔΑ͏ʹ
None
None
TestίϚϯυʹؔΘΔ࣮ • src/testing • ςετ࣮ߦ࣌ʹ͏T, BͳͲͷ࣮ • testing.commonͱ͍͏ߏମ͕ϝΠϯϩδοΫΛ͍࣋ͬͯΔ • ίϚϯυͷflagύʔε
• benchmarking, ΧόϨοδଌఆͳͲ • Fail, SkipͳͲͷ࣮
common
None
গͳ͍ʂ؆୯ʂ
Mergeͯ͠΄͍͠ʂ
Can you add tests?
ςετͷ࣮ߦ݁Ռͬͯ Ͳ͏ͬͯ ςετ͢ΔΜͩʁ
ςετͬͯͲ͏ͬͯ ςετ͢ΔΜͩʁ
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
For testing tests • testgoData • ͍͍ײ͡ʹfixtureΛಡΈࠐΜͩΓɺ ࣮ߦޙͷCleanupΛͯ͘͠ΕΔ
For testing tests • src/cmd/go/testdata/src/* • ςετ༻ͷFixtureΛఆٛ
all.bashΛճͤ ສࣄOK
Let’s Contribute!
ʕ ◔ϖ◔ʔ < Thank You!!