Add unit tests for TopoSort.