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
5.2k
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
Go Backends for frontends with GraphQL and gRPC
timakin
6
4k
Design Pattern for Image and Text Composition in Go
timakin
5
6.7k
Golang API Testing the HARD way
timakin
13
6.7k
Head First Golang Image Package
timakin
2
10k
React Native Beyond Prototype
timakin
2
1.6k
Performance Optimization on Google AppEngine
timakin
5
6.3k
testcache.pdf
timakin
1
160
How Go cache
timakin
1
92
How Go cache tests
timakin
1
3.2k
Other Decks in Programming
See All in Programming
PHPカンファレンス関西2025 基調講演
sugimotokei
6
1.1k
実践!App Intents対応
yuukiw00w
1
220
PHPUnitの限界をPlaywrightで補完するテストアプローチ
yuzneri
0
390
WebAssemblyインタプリタを書く ~Component Modelを添えて~
ruccho
1
640
Constant integer division faster than compiler-generated code
herumi
2
510
中級グラフィックス入門~効率的なメッシュレット描画~
projectasura
4
2.5k
No Install CMS戦略 〜 5年先を見据えたフロントエンド開発を考える / no_install_cms
rdlabo
0
470
Scale out your Claude Code ~自社専用Agentで10xする開発プロセス~
yukukotani
8
1.6k
新しいモバイルアプリ勉強会(仮)について
uetyo
1
250
Infer入門
riru
4
1.2k
MCP連携で加速するAI駆動開発/mcp integration accelerates ai-driven-development
bpstudy
0
280
「次に何を学べばいいか分からない」あなたへ──若手エンジニアのための学習地図
panda_program
3
720
Featured
See All Featured
The Invisible Side of Design
smashingmag
301
51k
Faster Mobile Websites
deanohume
308
31k
Bash Introduction
62gerente
614
210k
Balancing Empowerment & Direction
lara
1
530
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Making the Leap to Tech Lead
cromwellryan
134
9.5k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.4k
KATA
mclloyd
32
14k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
18
1.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
126
53k
It's Worth the Effort
3n
185
28k
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!!