Link
Embed
Share
Beginning
This slide
Copy link URL
Copy link URL
Copy iframe embed code
Copy iframe embed code
Copy javascript embed code
Copy javascript embed code
Share
Tweet
Share
Tweet
Slide 1
Slide 1 text
How Go test tests @__timakin__
Slide 2
Slide 2 text
• Seiji Takahashi • Github: timakin / Twitter: @__timakin__ • גࣜձࣾGunosy ৽نࣄۀ։ൃࣨ • Go / Swift ࣗݾհ
Slide 3
Slide 3 text
Copyright© Gunosy Inc. All Rights Reserved 3 Go / Python ΤϯδχΞืूத ▶https://gunosy.co.jp/recruit/ Gunosyɺ౦ژେֶʹ௨͏3ਓͷֶੜͷ ʮใΛੈքதͷਓʹ࠷దʹಧ͚͍ͨʯͱ͍͏͍͔Β࢝·Γ·ͨ͠ɻ ౦ূϚβʔζ্ɺຊώϧζͷΦϑΟεҠసΛܦͯɺ େ͖͍ͯ͘͠ΔձࣾͰ׆༂͍ͨ͠ϝϯόʔΛืू͍ͯ͠·͢ɻ
Slide 4
Slide 4 text
Test of test
Slide 5
Slide 5 text
No content
Slide 6
Slide 6 text
Go1.9~ ͕ؔͲΜͳग़ྗΛ͢Δͷ͔ɺ ExampleΛఆٛͰ͖ΔΑ͏ʹ
Slide 7
Slide 7 text
No content
Slide 8
Slide 8 text
No content
Slide 9
Slide 9 text
TestίϚϯυʹؔΘΔ࣮ • src/testing • ςετ࣮ߦ࣌ʹ͏T, BͳͲͷ࣮ • testing.commonͱ͍͏ߏମ͕ϝΠϯϩδοΫΛ͍࣋ͬͯΔ • ίϚϯυͷflagύʔε • benchmarking, ΧόϨοδଌఆͳͲ • Fail, SkipͳͲͷ࣮
Slide 10
Slide 10 text
common
Slide 11
Slide 11 text
No content
Slide 12
Slide 12 text
গͳ͍ʂ؆୯ʂ
Slide 13
Slide 13 text
Mergeͯ͠΄͍͠ʂ
Slide 14
Slide 14 text
Can you add tests?
Slide 15
Slide 15 text
ςετͷ࣮ߦ݁Ռͬͯ Ͳ͏ͬͯ ςετ͢ΔΜͩʁ
Slide 16
Slide 16 text
ςετͬͯͲ͏ͬͯ ςετ͢ΔΜͩʁ
Slide 17
Slide 17 text
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
Slide 18
Slide 18 text
For testing tests • src/cmd/go/go_test.go • Go commandsͷςετ࣮ߦ
Slide 19
Slide 19 text
For testing tests • testgoData • ͍͍ײ͡ʹfixtureΛಡΈࠐΜͩΓɺ ࣮ߦޙͷCleanupΛͯ͘͠ΕΔ
Slide 20
Slide 20 text
For testing tests • src/cmd/go/testdata/src/* • ςετ༻ͷFixtureΛఆٛ
Slide 21
Slide 21 text
all.bashΛճͤ ສࣄOK
Slide 22
Slide 22 text
Let’s Contribute!
Slide 23
Slide 23 text
ʕ ◔ϖ◔ʔ < Thank You!!