~ubuntu-branches/ubuntu/vivid/mkgmap/vivid

« back to all changes in this revision

Viewing changes to test/uk/me/parabola/imgfmt/app/srt/UnicodeCollatorTest.java

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2014-08-13 22:13:41 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20140813221341-i9dzzjuto2o7hfh6
Tags: 0.0.0+svn3333-1
* New upstream version
  Closes: #745097
* add debian/classpath (thanks for the patch to Manfred Stock
  <manfred.stock+debian@gmail.com>)
  Closes: #741596
* d/copyright: DEP5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or modify
 
5
 * it under the terms of the GNU General Public License version 3 or
 
6
 * version 2 as published by the Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
11
 * General Public License for more details.
 
12
 */
 
13
package uk.me.parabola.imgfmt.app.srt;
 
14
 
 
15
import java.text.Collator;
 
16
 
 
17
import uk.me.parabola.mkgmap.srt.SrtTextReader;
 
18
 
 
19
import org.junit.Before;
 
20
import org.junit.Test;
 
21
 
 
22
import static org.junit.Assert.*;
 
23
 
 
24
public class UnicodeCollatorTest {
 
25
 
 
26
        private Collator collator;
 
27
 
 
28
        @Before
 
29
        public void setUp() throws Exception {
 
30
                Sort sort = SrtTextReader.sortForCodepage(65001);
 
31
 
 
32
                collator = sort.getCollator();
 
33
                collator.setStrength(Collator.TERTIARY);
 
34
        }
 
35
 
 
36
        @Test
 
37
        public void testSimpleLessThan() {
 
38
                assertEquals(-1, collator.compare("G", "Ò"));
 
39
                assertEquals(-1, collator.compare("G", "Γ"));
 
40
        }
 
41
 
 
42
        @Test
 
43
        public void testExpand() {
 
44
                assertEquals(-1, collator.compare("!", "ß"));
 
45
                assertEquals(-1, collator.compare("A:", "Ǣ"));
 
46
        }
 
47
}