我一直在玩 Racket 和 Rackunit。我正在将我的小型静态站点生成器移植到 Racket 并编写单元测试并遇到了这个奇怪的问题。
#lang racket
(require (planet esilkensen/yaml:2:1))
(require rackunit)
(define some-yaml
(string->yaml " - name : ding"))
(check-equal? some-yaml '(#hash(("name" . "ding"))) )
有人可以向我解释为什么测试失败并显示以下输出:
Welcome to DrRacket, version 5.3.3 [3m].
Language: racket; memory limit: 128 MB.
--------------------
FAILURE
name: check-equal?
location: (#<path:/home/ding/Documents/racket/blog-generator> 7 0 119 45)
expression: (check-equal? x '(#hash(("name" . "ding"))))
actual: (#hash(("name" . "ding")))
expected: (#hash(("name" . "ding")))