-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCQLTermNodeTest.java
More file actions
52 lines (41 loc) · 1.22 KB
/
CQLTermNodeTest.java
File metadata and controls
52 lines (41 loc) · 1.22 KB
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
42
43
44
45
46
47
48
49
50
51
52
package org.z3950.zing.cql;
import org.junit.Test;
import static org.junit.Assert.*;
public class CQLTermNodeTest {
@Test
public void TestMaybeQuoteNull() {
assertNull(CQLTermNode.maybeQuote(null));
}
@Test
public void TestMaybeQuoteEmpty() {
assertEquals("\"\"", CQLTermNode.maybeQuote(""));
}
@Test
public void TestMaybeQuoteRelation() {
assertEquals("\"<\"", CQLTermNode.maybeQuote("<"));
}
@Test
public void TestMaybeQuoteSimple() {
assertEquals("simple", CQLTermNode.maybeQuote("simple"));
}
@Test
public void TestMaybeQuoteBlank() {
assertEquals("\"a b\"", CQLTermNode.maybeQuote("a b"));
}
@Test
public void TestMaybeQuoteQuote1() {
assertEquals("a\\\"", CQLTermNode.maybeQuote("a\""));
}
@Test
public void TestMaybeQuoteQuote2() {
assertEquals("a\\\"", CQLTermNode.maybeQuote("a\\\""));
}
@Test
public void TestMaybeQuoteQuote3() {
assertEquals("a" + "\\\\" + "\\\"", CQLTermNode.maybeQuote("a" + "\\\\" + "\""));
}
@Test
public void TestMaybeQuoteQuote4() {
assertEquals("a" + "\\\\" + "\\\"", CQLTermNode.maybeQuote("a" + "\\\\" + "\\\""));
}
}