<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>《Golang测试技术》的评论</title>
	<atom:link href="http://tonybai.com/2014/10/22/golang-testing-techniques/feed/" rel="self" type="application/rss+xml" />
	<link>https://tonybai.com/2014/10/22/golang-testing-techniques/</link>
	<description>一个程序员的心路历程</description>
	<lastBuildDate>Wed, 25 Mar 2026 09:21:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-7352</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Sat, 06 Apr 2019 12:19:03 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-7352</guid>
		<description>可以参考一下 这篇文章中提到的方法： https://blog.cloudflare.com/go-coverage-with-external-tests/</description>
		<content:encoded><![CDATA[<p>可以参考一下 这篇文章中提到的方法： <a href="https://blog.cloudflare.com/go-coverage-with-external-tests/" rel="nofollow">https://blog.cloudflare.com/go-coverage-with-external-tests/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：allen</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-7350</link>
		<dc:creator>allen</dc:creator>
		<pubDate>Fri, 05 Apr 2019 02:30:23 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-7350</guid>
		<description>请问下：起一个HTTP Server 之后，通过外部程序，如postman 、python写的测试case，调用server的接口，怎么收集这些case所覆盖的代码？</description>
		<content:encoded><![CDATA[<p>请问下：起一个HTTP Server 之后，通过外部程序，如postman 、python写的测试case，调用server的接口，怎么收集这些case所覆盖的代码？</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-7185</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Mon, 16 Apr 2018 00:59:34 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-7185</guid>
		<description>这个测试比较特殊，它本身被执行两次，一次是go test执行它，另外一个是在其内部cmd形式将go test编译出来的pkg.test在shell里重新执行一次。而你所说的“Going down in flames!”是在第二次&gt;输出的，但是这个输出在 go test中是看不到的，除非将cmd.Run改为：

s, err := cmd.CombinedOutput()

然后输出s。

&lt;code&gt;$go test -v .
=== RUN   TestCrasher
content: Going down in flames!

--- PASS: TestCrasher (0.01s)
PASS
ok      _/Users/tony/Test/Go/advtest    0.027s&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>这个测试比较特殊，它本身被执行两次，一次是go test执行它，另外一个是在其内部cmd形式将go test编译出来的pkg.test在shell里重新执行一次。而你所说的“Going down in flames!”是在第二次&gt;输出的，但是这个输出在 go test中是看不到的，除非将cmd.Run改为：</p>
<p>s, err := cmd.CombinedOutput()</p>
<p>然后输出s。</p>
<p><code>$go test -v .<br />
=== RUN   TestCrasher<br />
content: Going down in flames!</p>
<p>--- PASS: TestCrasher (0.01s)<br />
PASS<br />
ok      _/Users/tony/Test/Go/advtest    0.027s</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：small-pig</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-7184</link>
		<dc:creator>small-pig</dc:creator>
		<pubDate>Sun, 15 Apr 2018 13:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-7184</guid>
		<description>请问最后一个测试为什么看不到
Crasher里的fmt的结果Going down in flames!</description>
		<content:encoded><![CDATA[<p>请问最后一个测试为什么看不到<br />
Crasher里的fmt的结果Going down in flames!</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：疯子的自留地</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-1324</link>
		<dc:creator>疯子的自留地</dc:creator>
		<pubDate>Thu, 24 Mar 2016 01:32:05 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-1324</guid>
		<description>感谢分享,之前http测试我还是自己写的http测试包用来给项目做api接口测试,也没去看httptest这个包,原来自带了都-_-&#124;&#124;</description>
		<content:encoded><![CDATA[<p>感谢分享,之前http测试我还是自己写的http测试包用来给项目做api接口测试,也没去看httptest这个包,原来自带了都-_-||</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-1074</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Tue, 05 May 2015 09:31:55 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-1074</guid>
		<description>我的理解是在设计并发测试时，以往我们常用sleep在两个或多个线程or goroutine之间进行“测试交互”，这里Andrew建议搭建使用go自身提供的并发原语，比如channel。</description>
		<content:encoded><![CDATA[<p>我的理解是在设计并发测试时，以往我们常用sleep在两个或多个线程or goroutine之间进行“测试交互”，这里Andrew建议搭建使用go自身提供的并发原语，比如channel。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：bigwhite</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-1073</link>
		<dc:creator>bigwhite</dc:creator>
		<pubDate>Tue, 05 May 2015 09:31:54 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-1073</guid>
		<description>我的理解是在设计并发测试时，以往我们常用sleep在两个或多个线程or goroutine之间进行“测试交互”，这里Andrew建议搭建使用go自身提供的并发原语，比如channel。</description>
		<content:encoded><![CDATA[<p>我的理解是在设计并发测试时，以往我们常用sleep在两个或多个线程or goroutine之间进行“测试交互”，这里Andrew建议搭建使用go自身提供的并发原语，比如channel。</p>
]]></content:encoded>
	</item>
	<item>
		<title>作者：[北京]光阴的故事</title>
		<link>https://tonybai.com/2014/10/22/golang-testing-techniques/#comment-1072</link>
		<dc:creator>[北京]光阴的故事</dc:creator>
		<pubDate>Tue, 05 May 2015 07:25:53 +0000</pubDate>
		<guid isPermaLink="false">http://tonybai.com/?p=1579#comment-1072</guid>
		<description>我们可以使用Go的并发原语让那些奇怪不靠谱的sleep驱动的测试更加值得信赖。并发原语是什么意思呀？</description>
		<content:encoded><![CDATA[<p>我们可以使用Go的并发原语让那些奇怪不靠谱的sleep驱动的测试更加值得信赖。并发原语是什么意思呀？</p>
]]></content:encoded>
	</item>
</channel>
</rss>
