-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use actual path length instead of idealized
- Loading branch information
Jens Gåsemyr Magnus
committed
Apr 25, 2019
1 parent
2e0e503
commit a85cc19
Showing
2 changed files
with
24 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
from .. import cli | ||
from .. import etw | ||
|
||
|
||
def test_main(): | ||
_ = cli.main([]) | ||
# TODO: | ||
# def test_ns_ne_nt(): | ||
# s = [3, 2, 1, 2, 3, 4, 5, 6, 7] | ||
# t = [1, 2, 3, 4, 4.2, 4, 4, 5, 5, 5] | ||
# cost = lambda i, k: 1.0 + abs(s[i] - t[k]) | ||
|
||
|
||
def test_ns_eq_nt(): | ||
s = [3, 2, 1, 2, 3, 4, 5, 6, 6, 7] | ||
t = [1, 2, 3, 4, 4.2, 4, 4, 5, 5, 5] | ||
|
||
ref_path = ([2, 3, 4, 5, 5, 5, 5, 6, 6, 6], [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) | ||
path, _, _, _ = etw(len(s), len(t), | ||
cost=lambda i, k: 1.0 + abs(s[i] - t[k])) | ||
|
||
assert path == ref_path |