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.
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.
13
package uk.me.parabola.imgfmt.app.srt;
15
import java.text.Collator;
17
import uk.me.parabola.mkgmap.srt.SrtTextReader;
19
import org.junit.Before;
20
import org.junit.Test;
22
import static org.junit.Assert.*;
24
public class UnicodeCollatorTest {
26
private Collator collator;
29
public void setUp() throws Exception {
30
Sort sort = SrtTextReader.sortForCodepage(65001);
32
collator = sort.getCollator();
33
collator.setStrength(Collator.TERTIARY);
37
public void testSimpleLessThan() {
38
assertEquals(-1, collator.compare("G", "Ò"));
39
assertEquals(-1, collator.compare("G", "Γ"));
43
public void testExpand() {
44
assertEquals(-1, collator.compare("!", "ß"));
45
assertEquals(-1, collator.compare("A:", "Ǣ"));