summary refs log tree commit diff stats
path: root/TODO
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-04-27 01:09:06 +0200
committerhut <hut@lavabit.com>2010-04-27 01:09:06 +0200
commit2e631f441dc2cc89cbdf8744ee31b98112b2395d (patch)
tree954ae598a849aeb6a9162dc6715ad6b5c004f6b8 /TODO
parentf01ef1a01d07151b5c01df7887a11c9e4c5987f3 (diff)
downloadranger-2e631f441dc2cc89cbdf8744ee31b98112b2395d.tar.gz
Closed #83 since I implemented :mark
Diffstat (limited to 'TODO')
-rw-r--r--TODO2
1 files changed, 1 insertions, 1 deletions
diff --git a/TODO b/TODO
index c809065c..169fa6d6 100644
--- a/TODO
+++ b/TODO
@@ -52,7 +52,7 @@ General
    (X) #79  10/04/08  tab number zero
    ( ) #80  10/04/08  when closing tabs, avoid gaps?
    ( ) #81  10/04/15  system crash when previewing /proc/kcore with root permissions
-   ( ) #83  10/04/19  better ways to mark files. eg by regexp, filetype,..
+   (X) #83  10/04/19  better ways to mark files. eg by regexp, filetype,..
    ( ) #86  10/04/21  narg for move_parent
    ( ) #60  10/02/05  utf support improvable
 
#bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.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 */
# -*- encoding: utf8 -*-
# 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/>.

from unittest import TestCase, main
from ranger.ext.utfwidth import *

a_ascii = "a"      # width = 1, bytes = 1
a_umlaut = "ä"     # width = 1, bytes = 2
a_katakana = "ア"  # width = 2, bytes = 3
# need one with width = 1 & bytes = 3

class Test(TestCase):
	def test_utf_byte_length(self):
		self.assertEqual(1, utf_byte_length(a_ascii))
		self.assertEqual(2, utf_byte_length(a_umlaut))
		self.assertEqual(3, utf_byte_length(a_katakana))

	def test_uwid(self):
		self.assertEqual(1, uwid(a_ascii))
		self.assertEqual(1, uwid(a_umlaut))
		self.assertEqual(2, uwid(a_katakana))
		self.assertEqual(3, uwid(a_katakana + a_umlaut))
		self.assertEqual(4, uwid("asdf"))
		self.assertEqual(5, uwid("löööl"))
		self.assertEqual(6, uwid("バババ"))

if __name__ == '__main__': main()