Skip to content

Commit dda3619

Browse files
author
DvirDukhan
authored
fix character handling in params (#84)
* fix charecter handling in params * added char test
1 parent 4cf34bb commit dda3619

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/java/com/redislabs/redisgraph/impl/Utils.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ private static String valueToString(Object value) {
9999
if(String.class.isInstance(value)){
100100
return quoteString((String) value);
101101
}
102+
if(Character.class.isInstance((value))){
103+
return quoteString(((Character)value).toString());
104+
}
102105

103106
if(value.getClass().isArray()){
104107
return arrayToString((Object[]) value);

src/test/java/com/redislabs/redisgraph/RedisGraphAPITest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -879,8 +879,8 @@ public void testPath(){
879879

880880
@Test
881881
public void testParameters(){
882-
Object[] parameters = {1, 2.3, true, false, null, "str", Arrays.asList(1,2,3), new Integer[]{1,2,3}};
883-
Object[] expected_anwsers = {1L, 2.3, true, false, null, "str", Arrays.asList(1L, 2L, 3L), new Long[]{1L, 2L, 3L}};
882+
Object[] parameters = {1, 2.3, true, false, null, "str", 'a', "b" ,Arrays.asList(1,2,3), new Integer[]{1,2,3}};
883+
Object[] expected_anwsers = {1L, 2.3, true, false, null, "str", "a", "b", Arrays.asList(1L, 2L, 3L), new Long[]{1L, 2L, 3L}};
884884
Map<String, Object> params = new HashMap<>();
885885
for (int i=0; i < parameters.length; i++) {
886886
Object param = parameters[i];

0 commit comments

Comments
 (0)