Skip to content

Commit

Permalink
add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashleyhx committed Sep 19, 2023
1 parent e707d2d commit ff22ee4
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/common/types/value/value.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,16 +231,16 @@ void Value::copyValueFrom(const uint8_t* value) {
val.int8Val = *((int8_t*)value);
} break;
case LogicalTypeID::UINT64: {
val.int64Val = *((uint64_t*)value);
val.uint64Val = *((uint64_t*)value);
} break;
case LogicalTypeID::UINT32: {
val.int32Val = *((uint32_t*)value);
val.uint32Val = *((uint32_t*)value);
} break;
case LogicalTypeID::UINT16: {
val.int16Val = *((uint16_t*)value);
val.uint16Val = *((uint16_t*)value);
} break;
case LogicalTypeID::UINT8: {
val.int8Val = *((uint8_t*)value);
val.uint8Val = *((uint8_t*)value);
} break;
case LogicalTypeID::BOOL: {
val.booleanVal = *((bool*)value);
Expand Down
10 changes: 10 additions & 0 deletions test/test_files/tinysnb/function/cast.test
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,16 @@ Hubert Blaine Wolfeschlegelsteinhausenbergerdorff
2.000000
2.000000

-LOG CastDoubleToUInt
-STATEMENT RETURN to_uint8(to_double(1)), to_uint16(to_double(2)), to_uint32(to_double(3)), to_uint64(to_double(4))
---- 1
1|2|3|4

-LOG CastFloatToUInt
-STATEMENT RETURN to_uint8(to_float(1)), to_uint16(to_float(2)), to_uint32(to_float(3)), to_uint64(to_float(4))
---- 1
1|2|3|4

-LOG CastFloatToDouble
-STATEMENT MATCH (p:person) RETURN to_double(p.height)
---- 8
Expand Down
40 changes: 40 additions & 0 deletions test/test_files/tinysnb/function/list.test
Original file line number Diff line number Diff line change
Expand Up @@ -1250,6 +1250,46 @@ True
---- 1
[5,3,2,1,]

-LOG ListReverseSortUInt8
-STATEMENT Return list_reverse_sort([to_uint8(2), NULL, to_uint8(3), to_uint8(1), to_uint8(5)]);
---- 1
[,5,3,2,1]

-LOG ListReverseSortUInt8WithNullsLast
-STATEMENT Return list_reverse_sort([to_uint8(2), NULL, to_uint8(3), to_uint8(1), to_uint8(5)], 'NULLS LAST');
---- 1
[5,3,2,1,]

-LOG ListReverseSortUInt16
-STATEMENT Return list_reverse_sort([to_uint16(2), NULL, to_uint16(3), to_uint16(1), to_uint16(5)]);
---- 1
[,5,3,2,1]

-LOG ListReverseSortUInt16WithNullsLast
-STATEMENT Return list_reverse_sort([to_uint16(2), NULL, to_uint16(3), to_uint16(1), to_uint16(5)], 'NULLS LAST');
---- 1
[5,3,2,1,]

-LOG ListReverseSortUInt32
-STATEMENT Return list_reverse_sort([to_uint32(2), NULL, to_uint32(3), to_uint32(1), to_uint32(5)]);
---- 1
[,5,3,2,1]

-LOG ListReverseSortUInt32WithNullsLast
-STATEMENT Return list_reverse_sort([to_uint32(2), NULL, to_uint32(3), to_uint32(1), to_uint32(5)], 'NULLS LAST');
---- 1
[5,3,2,1,]

-LOG ListReverseSortUInt64
-STATEMENT Return list_reverse_sort([to_uint64(2), NULL, to_uint64(3), to_uint64(1), to_uint64(5)]);
---- 1
[,5,3,2,1]

-LOG ListReverseSortUInt64WithNullsLast
-STATEMENT Return list_reverse_sort([to_uint64(2), NULL, to_uint64(3), to_uint64(1), to_uint64(5)], 'NULLS LAST');
---- 1
[5,3,2,1,]

-LOG ListDistinctWithFloat
-STATEMENT Return list_reverse_sort([to_float(1.1), to_float(1.1), NULL, to_float(3.4), to_float(1.2), to_float(5.1)]);
---- 1
Expand Down

0 comments on commit ff22ee4

Please sign in to comment.