summary refs log tree commit diff stats
path: root/test/tc_history.py
blob: e33775329eee5a96ceb9251f94c87382dba04abe (plain) (blame)
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
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.top())
		self.assertEqual([3,4], list(hist))

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

		# no change if top == bottom
		self.assertEqual(hist.top(), hist.bottom())
		last_top = hist.top()
		hist.back()
		self.assertEqual(hist.top(), last_top)


		hist.forward()
		hist.forward()
		self.assertEqual(5, hist.top())
		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()
>
                                                     


                                                               
                                                                    
                                                           
                                                                              


                                                              
#include "config.h"

#ifdef HAVE_LIBOTR
void cmd_otr_shows_usage_when_no_args(void **state);
void cmd_otr_shows_usage_when_invalid_subcommand(void **state);
void cmd_otr_log_shows_usage_when_no_args(void **state);
void cmd_otr_log_shows_usage_when_invalid_subcommand(void **state);
void cmd_otr_log_on_enables_logging(void **state);
void cmd_otr_log_off_disables_logging(void **state);
void cmd_otr_redact_redacts_logging(void **state);
void cmd_otr_log_on_shows_warning_when_chlog_disabled(void **state);
void cmd_otr_log_redact_shows_warning_when_chlog_disabled(void **state);
void cmd_otr_warn_shows_usage_when_no_args(void **state);
void cmd_otr_warn_shows_usage_when_invalid_arg(void **state);
void cmd_otr_warn_on_enables_unencrypted_warning(void **state);
void cmd_otr_warn_off_disables_unencrypted_warning(void **state);
void cmd_otr_libver_shows_libotr_version(void **state);
void cmd_otr_gen_shows_message_when_not_connected(void **state);
void cmd_otr_gen_generates_key_for_connected_account(void **state);
void cmd_otr_gen_shows_message_when_disconnected(void **state);
void cmd_otr_gen_shows_message_when_undefined(void **state);
void cmd_otr_gen_shows_message_when_started(void **state);
void cmd_otr_gen_shows_message_when_connecting(void **state);
void cmd_otr_gen_shows_message_when_disconnecting(void **state);
void cmd_otr_myfp_shows_message_when_disconnected(void **state);
void cmd_otr_myfp_shows_message_when_undefined(void **state);
void cmd_otr_myfp_shows_message_when_started(void **state);
void cmd_otr_myfp_shows_message_when_connecting(void **state);
void cmd_otr_myfp_shows_message_when_disconnecting(void **state);
void cmd_otr_myfp_shows_message_when_no_key(void **state);
void cmd_otr_myfp_shows_my_fingerprint(void **state);
void cmd_otr_theirfp_shows_message_when_in_console(void **state);
void cmd_otr_theirfp_shows_message_when_in_muc(void **state);
void cmd_otr_theirfp_shows_message_when_in_private(void **state);
void cmd_otr_theirfp_shows_message_when_non_otr_chat_window(void **state);
void cmd_otr_theirfp_shows_fingerprint(void **state);
void cmd_otr_start_shows_message_when_in_console(void **state);
void cmd_otr_start_shows_message_when_in_muc(void **state);
void cmd_otr_start_shows_message_when_in_private(void **state);
void cmd_otr_start_shows_message_when_already_started(void **state);
void cmd_otr_start_shows_message_when_no_key(void **state);
void cmd_otr_start_sends_otr_query_message_to_current_recipeint(void **state);
#else
void cmd_otr_shows_message_when_otr_unsupported(void **state);
#endif