Skip to content

Commit

Permalink
[wasm][debugger] Support indexing Dictionary by string key (dotnet#90108
Browse files Browse the repository at this point in the history
)

* Enabling tests, they are working.

* Adding more tests.
  • Loading branch information
thaystg authored Aug 8, 2023
1 parent face88a commit f0bfe0b
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -633,17 +633,19 @@ await EvaluateOnCallFrameAndCheck(id,
("f[\"-\"]", TBool(false)),
("f[\'-\']", TString("res_-")),
("f[true]", TString("True")),
// ("f[1.23]", TNumber(1)) // Not supported yet - float/double
// FixMe: https://github.com/dotnet/runtime/issues/76013
// ("f.indexedByStr[\"1\"]", TBool(true)) // keyNotFoundException
// ("f.indexedByStr[\"111\"]", TBool(false)), // keyNotFoundException
// ("f.indexedByStr[\"true\"]", TBool(true)), // keyNotFoundException
//("f[1.23]", TNumber(1)) // Not supported yet - float/double
("f.indexedByStr[\"1\"]", TBool(true)),
("f.indexedByStr[\"111\"]", TBool(false)),
("f.indexedByStr[\"true\"]", TBool(true)),
("f.indexedByChar[\'i\']", TString("I")),
("f.indexedByChar[\'5\']", TString("5")),
("f.indexedByBool[true]", TString("TRUE")),
("f.indexedByBool[false]", TString("FALSE"))
);
var (_, res) = await EvaluateOnCallFrame(id,"f.indexedByStr[\"invalid\"]", expect_ok: false);
Assert.True(res.Error["result"]?["description"]?.Value<string>().StartsWith("Cannot evaluate '(f.indexedByStr[\"invalid\"]", StringComparison.Ordinal));
(_, res) = await EvaluateOnCallFrame(id,"f.indexedByStr[null]", expect_ok: false);
Assert.True(res.Error["result"]?["description"]?.Value<string>().StartsWith("Cannot evaluate '(f.indexedByStr[null]", StringComparison.Ordinal));
});

[Fact]
Expand Down

0 comments on commit f0bfe0b

Please sign in to comment.