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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Seiji Takahashi
December 11, 2017
Programming
7.4k
2
Share
How Go test tests
Presentation for golang.tokyo #11
Seiji Takahashi
December 11, 2017
More Decks by Seiji Takahashi
See All by Seiji Takahashi
営業、広報、開発。 多面的なAIネイティブ化のための 基盤について
timakin
0
170
権限と承認 〜ユーザー信頼性に繋がる管理画面の根幹について〜
timakin
0
890
Go Backends for frontends with GraphQL and gRPC
timakin
6
4.2k
Design Pattern for Image and Text Composition in Go
timakin
5
6.9k
Golang API Testing the HARD way
timakin
13
7.1k
Head First Golang Image Package
timakin
2
10k
React Native Beyond Prototype
timakin
2
1.7k
Performance Optimization on Google AppEngine
timakin
5
6.6k
testcache.pdf
timakin
1
220
Other Decks in Programming
See All in Programming
ビジネスモデルから紐解く、AI+型駆動開発
hirokiomote
2
4.6k
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
270
タクシーアプリ『GO』の バックエンド開発のおける AI利活用と若者のすべて
pyama86
3
1.8k
Augmenting AI with the Power of Jakarta EE
ivargrimstad
0
410
誰も頼んでない機能を出荷した話
zekutax
0
150
Spec-Driven Development with AI-Agents: From High-Level Requirements to Working Software
antonarhipov
2
400
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
色即是空、空即是色、データサイエンス
kamoneggi
1
240
OSもどきOS
arkw
0
350
Inside Stream API
skrb
1
430
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
990
Signal Forms: Beyond the Basics @ngBaguette 2026 in Paris
manfredsteyer
PRO
0
180
Featured
See All Featured
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
150
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
We Have a Design System, Now What?
morganepeng
55
8.2k
Design in an AI World
tapps
1
220
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.5k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Are puppies a ranking factor?
jonoalderson
1
3.4k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2k
The SEO Collaboration Effect
kristinabergwall1
1
470
Side Projects
sachag
455
43k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
210
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!!