<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Golden File on PlumePHP</title><link>https://plumephp.com/tags/golden-file/</link><description>Recent content in Golden File on PlumePHP</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Tue, 08 Oct 2024 10:12:00 +0800</lastBuildDate><atom:link href="https://plumephp.com/tags/golden-file/index.xml" rel="self" type="application/rss+xml"/><item><title>Go 黄金文件测试入门：适合输出很长的文本和 JSON</title><link>https://plumephp.com/go-golden-file-tests-2024/</link><pubDate>Tue, 08 Oct 2024 10:12:00 +0800</pubDate><guid>https://plumephp.com/go-golden-file-tests-2024/</guid><description>&lt;p&gt;有些函数的输出很长，比如生成 Markdown、渲染配置文件、格式化 JSON、生成 SQL。你当然可以在测试里写一个很长的字符串常量，但测试文件会变得难读。黄金文件测试，也叫 golden file test，就是把期望输出放在单独文件里，测试时读取文件并比较。&lt;/p&gt;</description></item></channel></rss>