summary refs log tree commit diff stats
path: root/worker
Commit message (Expand)AuthorAgeFilesLines
* Make search more lenientJeffas2020-02-261-1/+2
* Add missing notmuch build tagsJeffas2020-02-262-0/+4
* Ensure new directory exists before unwatching oldGalen Abell2020-02-251-5/+6
* lib/msgstore: debounce directoryUpdateRequestsReto Brunner2020-02-251-0/+2
* notmuch: refresh dirlist in backgroundReto Brunner2020-02-163-1/+27
* notmuch: add internal event loopReto Brunner2020-02-163-12/+38
* notmuch: emit DirInfo upon requestReto Brunner2020-02-161-12/+44
* Request DirInfo whenever the unread count may have changedReto Brunner2020-02-161-0/+7
* imap: fix double closing idleStopReto Brunner2020-02-161-2/+4
* notmuch: avoid stale DBsReto Brunner2020-02-161-99/+133
* worker/lib/parse: be more tolerant with parsing email addressesTimmy Douglas2020-02-061-1/+1
* imap: emit messageinfo when changing read state.Reto Brunner2020-01-241-2/+17
* worker/imap: don't decode in FetchFullMessage.Reto Brunner2020-01-181-27/+2
* maildir/notmuch: don't re-encode readersReto Brunner2020-01-051-37/+4
* imap: decode reader prior to returning themReto Brunner2020-01-051-10/+90
* FetchBodyParts: decode source in the workersReto Brunner2020-01-051-2/+4
* Add labels to index format (%g)Reto Brunner2019-12-273-0/+14
* notmuch: emit LabelList eventReto Brunner2019-12-212-0/+29
* add LabelList eventReto Brunner2019-12-211-0/+5
* decode(RFC 2047) imap headers to fix encoding in subject & filenamesLeszek CimaƂa2019-12-071-5/+25
* Parse Reply-To header while parsing envelopeSrivathsan Murali2019-11-171-0/+5
* worker/imap: Fix seqMap race conditionKevin Kuehler2019-11-101-1/+3
* Notmuch: be resilient to config errorsReto Brunner2019-11-011-3/+22
* notmuch: ignore comments and blank lines when processing query-map fileMatt Snider2019-11-011-0/+4
* Fix: oauthbearer runtime errorFrode Aannevik2019-10-161-6/+7
* Change search flagsJeffas2019-09-202-4/+12
* notmuch: add sort functionalityReto Brunner2019-09-201-6/+41
* Add sorting functionalityJeffas2019-09-204-7/+319
* Add directory info messagesJeffas2019-09-181-16/+55
* Add basic searching to the maildir backendJeffas2019-09-162-1/+260
* notmuch: implement ModifyLabelsReto Brunner2019-09-161-26/+61
* notmuch: sync maildir flagsReto Brunner2019-09-161-1/+4
* notmuch: extract all notmuch db operations.Reto Brunner2019-09-163-175/+250
* Add modify-labels commandReto Brunner2019-09-121-0/+7
* Add new search behaviour for imapJeffas2019-09-111-4/+19
* all: rewrite references to strings.Index to strings.ContainsWagner Riffel2019-09-041-1/+1
* notmuch: add search / filter capabilitiesReto Brunner2019-08-291-9/+29
* extract search criteria parsing into the backendsReto Brunner2019-08-293-11/+50
* Notmuch: use adhoc write connection.Reto Brunner2019-08-262-30/+147
* imap worker: do not copy mailbox status mutexWagner Riffel2019-08-261-2/+3
* maildir: Preserve flags when copying messagesBen Burwell2019-08-081-20/+2
* Add notmuch backendReto Brunner2019-08-083-0/+521
* Extract message parsing to common worker moduleReto Brunner2019-08-082-220/+256
* Don't print imap errors to uiJelle Besseling2019-08-081-0/+1
* Clean maildirs when openedBen Burwell2019-08-021-0/+4
* Fix error handling in maildir workerNicolai Dagestad2019-07-191-14/+7
* Register worker in init.Reto Brunner2019-07-195-20/+53
* maildir: Watch for new messagesBen Burwell2019-07-172-14/+73
* Fix header decodingBen Burwell2019-07-171-13/+16
* Fix missing format fields in maildir/container.goDrew DeVault2019-07-131-2/+2
ral.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

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()