From 80d44157374cedf551d5bd596e9e131a1b3b5cf7 2012-11-20 20:50:15 From: Takafumi Arakaki Date: 2012-11-20 20:50:15 Subject: [PATCH] Add a test for history search with unique=True --- diff --git a/IPython/core/tests/test_history.py b/IPython/core/tests/test_history.py index 95a25f3..8c3ac07 100644 --- a/IPython/core/tests/test_history.py +++ b/IPython/core/tests/test_history.py @@ -89,6 +89,7 @@ def test_history(): # Check get_hist_search gothist = ip.history_manager.search("*test*") nt.assert_equal(list(gothist), [(1,2,hist[1])] ) + gothist = ip.history_manager.search("*=*") nt.assert_equal(list(gothist), [(1, 1, hist[0]), @@ -97,12 +98,22 @@ def test_history(): newhist[0], newhist[2], newhist[3]]) + gothist = ip.history_manager.search("*=*", n=4) nt.assert_equal(list(gothist), [(1, 3, hist[2]), newhist[0], newhist[2], newhist[3]]) + + gothist = ip.history_manager.search("*=*", unique=True) + nt.assert_equal(list(gothist), + [(1, 1, hist[0]), + (1, 2, hist[1]), + (1, 3, hist[2]), + newhist[2], + newhist[3]]) + gothist = ip.history_manager.search("b*", output=True) nt.assert_equal(list(gothist), [(1,3,(hist[2],"spam"))] )