mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-28 14:24:45 +00:00
add AStar test
This commit is contained in:
parent
4d061bd932
commit
b9b2f70673
2 changed files with 131 additions and 0 deletions
|
@ -240,6 +240,26 @@ mod test_load {
|
|||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn load_astar() {
|
||||
test_async(async {
|
||||
let subs_by_module = MutMap::default();
|
||||
let loaded_module = load_fixture("interface_with_deps", "AStar", subs_by_module).await;
|
||||
|
||||
expect_types(
|
||||
loaded_module,
|
||||
hashmap! {
|
||||
"findPath" => "{ costFunction : (position, position -> Float), end : position, moveFunction : (position -> Set position), start : position } -> Result (List position) [ KeyNotFound ]*",
|
||||
"initialModel" => "position -> Model position",
|
||||
"reconstructPath" => "Map position position, position -> List position",
|
||||
"updateCost" => "position, position, Model position -> Model position",
|
||||
"cheapestOpen" => "(position -> Float), Model position -> Result position [ KeyNotFound ]*",
|
||||
"astar" => "(position, position -> Float), (position -> Set position), position, Model position -> [ Err [ KeyNotFound ]*, Ok (List position) ]*",
|
||||
},
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn load_principal_types() {
|
||||
test_async(async {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue