about summary refs log tree commit diff stats
path: root/html/070string.mu.html
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-10-29 12:15:03 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-10-29 12:15:03 -0700
commit4f10b93a6a910a2457ce5f2aa76ba13047136cca (patch)
tree7139461275398bd907bfa2788138f0ba95b7f839 /html/070string.mu.html
parentcdd6fd09673faa6ed72d1b7f52333c12100df049 (diff)
downloadmu-4f10b93a6a910a2457ce5f2aa76ba13047136cca.tar.gz
2314 - final tweaks to trace
I checked these commands:

  $ mu x.mu
  $ grep "===" .traces/interactive
  $ grep "===\|---" .traces/interactive
Diffstat (limited to 'html/070string.mu.html')
0 files changed, 0 insertions, 0 deletions
+ Test Case' href='/akspecs/ranger/commit/test/tc_history.py?h=v1.9.3&id=22bb7e358ccd6efc58c38b8703b6818131905a75'>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()