about summary refs log tree commit diff stats
path: root/TODO
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-13 18:21:38 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-13 18:21:38 +0200
commitefa7e514012865fcb3e9ea6e7d5b5c87d84353e5 (patch)
tree0de62a03a41d3c374abaad67146b9caf3c854615 /TODO
parentc47da143bdf5b4e3924a411f42648d4b3e86ff00 (diff)
downloaddwm-efa7e514012865fcb3e9ea6e7d5b5c87d84353e5.tar.gz
several other additions/fixes, dwm is quite usable already
Diffstat (limited to 'TODO')
0 files changed, 0 insertions, 0 deletions
ry by a couple of methods' href='/akspecs/ranger/commit/test/tc_history.py?h=v1.7.0-emacs&id=3dbefa71785bf61b8f28d4a780064f3f4e04dcb5'>3dbefa71 ^
22bb7e35 ^

3dbefa71 ^

22bb7e35 ^
3dbefa71 ^
22bb7e35 ^

3dbefa71 ^


22bb7e35 ^
3dbefa71 ^
22bb7e35 ^
3dbefa71 ^
22bb7e35 ^


3dbefa71 ^
22bb7e35 ^








1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
                                                            
 
                                    



                                   
                               






                                                     
                                                   

                                                   

                                               
                           
                                                   

                                                 


                                                               
                           
                                                      
 
                                               


                              
                                                   








                                                     
if __name__ == '__main__': from __init__ import init; init()

from ranger.container import History
from unittest import TestCase, main
import unittest

class Test(TestCase):
	def test_history(self):
		hist = History(3)
		for i in range(6):
			hist.add(i)
		self.assertEqual([3,4,5], list(hist))

		hist.back()

		self.assertEqual(4, hist.current())
		self.assertEqual([3,4], list(hist))

		self.assertEqual(5, hist.top())

		hist.back()
		self.assertEqual(3, hist.current())
		self.assertEqual([3], list(hist))

		# no change if current == bottom
		self.assertEqual(hist.current(), hist.bottom())
		last = hist.current()
		hist.back()
		self.assertEqual(hist.current(), last)

		self.assertEqual(5, hist.top())

		hist.forward()
		hist.forward()
		self.assertEqual(5, hist.current())
		self.assertEqual([3,4,5], list(hist))


		self.assertEqual(3, hist.bottom())
		hist.add(6)
		self.assertEqual(4, hist.bottom())
		self.assertEqual([4,5,6], list(hist))

if __name__ == '__main__': main()