add/fix tests for topological sort