Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在enlive中找到了以下代码:
net.cgrand.enlive-html=> (source node-selector?) (defn node-selector? [selector] (not (fragment-selector? selector)))
并考虑将其重构为以下代码:
(def node-selector? (complement fragment-selector?))
如何验证重构的完整性,以便通过更改正确处理所有案例?
咳嗽测试咳嗽并努力思考。您必须确保参数和结果域没有改变(处理真实值时要特别小心)。在这种情况下,更改似乎无害,但您会丢失一些东西:doc 不再记录 arglist。另一个微妙的后果:当你重新定义片段选择器?,节点选择器?仍然是指旧的片段选择器?