我似乎无法在我的 fsunit 测试中获得正确的缩进。我一直被告知要使用 ML 风格的“使用 let ... in”,但这样做意味着编译器无法读取下一个测试的名称。有什么建议么 ?
[<TestFixture>]
module ``reading yaml files`` =
let yamlReader = new yamlReader()
let yamlConfig = yamlReader.read("./testFiles/config.yaml")
[<Test>] ``should parse root property of a yaml file`` ()=
yamlConfig.ContainsKey(new YamlScalar("token1")) |> should equal true
[<Test>] ``should parse nested propery of a yaml file`` ()=
let token1 = yamlConfig.[new YamlScalar("token1")] :?> YamlMapping
let env3 = token1.[new YamlScalar("env3")] :?> YamlScalar
env3.Value |> should equal "value3"
[<Test>] ``should convert yamldocument to digestable format`` ()=
let tokens = yamlReader.toTokens yamlConfig
let firstToken = (Seq.head tokens)
firstToken.name |> should equal "token2"