@@ -1109,28 +1109,44 @@ export async function transactionTest(
1109
1109
responseData . push ( [ 'smove(key7, key7, "non_existing_member")' , false ] ) ;
1110
1110
baseTransaction . scard ( key7 ) ;
1111
1111
responseData . push ( [ "scard(key7)" , 0 ] ) ;
1112
- baseTransaction . zadd ( key8 , [
1113
- { element : member1 , score : 1 } ,
1114
- { element : member2 , score : 2 } ,
1115
- { element : member3 , score : 3.5 } ,
1116
- { element : member4 , score : 4 } ,
1117
- { element : member5 , score : 5 } ,
1118
- ] ) ;
1119
- responseData . push ( [ "zadd(key8, { ... } " , 5 ] ) ;
1112
+ baseTransaction . zadd ( key8 , {
1113
+ member1 : 1 ,
1114
+ member2 : 2 ,
1115
+ member3 : 3.5 ,
1116
+ member4 : 4 ,
1117
+ member5 : 5 ,
1118
+ infMember : "+inf" ,
1119
+ negInfMember : "-inf" ,
1120
+ } ) ;
1121
+ responseData . push ( [ "zadd(key8, { ... } " , 7 ] ) ;
1120
1122
baseTransaction . zrank ( key8 , member1 ) ;
1121
- responseData . push ( [ 'zrank(key8, "member1")' , 0 ] ) ;
1123
+ responseData . push ( [ 'zrank(key8, "member1")' , 1 ] ) ;
1124
+ baseTransaction . zrank ( key8 , "negInfMember" ) ;
1125
+ responseData . push ( [ 'zrank(key8, "negInfMember")' , 0 ] ) ;
1122
1126
1123
1127
if ( ! cluster . checkIfServerVersionLessThan ( "7.2.0" ) ) {
1124
1128
baseTransaction . zrankWithScore ( key8 , member1 ) ;
1125
- responseData . push ( [ 'zrankWithScore(key8, "member1")' , [ 0 , 1 ] ] ) ;
1129
+ responseData . push ( [ 'zrankWithScore(key8, "member1")' , [ 1 , 1 ] ] ) ;
1130
+ baseTransaction . zrankWithScore ( key8 , "negInfMember" ) ;
1131
+ responseData . push ( [
1132
+ 'zrankWithScore(key8, "negInfMember")' ,
1133
+ [ 0 , - Infinity ] ,
1134
+ ] ) ;
1126
1135
}
1127
1136
1128
1137
baseTransaction . zrevrank ( key8 , "member5" ) ;
1129
- responseData . push ( [ 'zrevrank(key8, "member5")' , 0 ] ) ;
1138
+ responseData . push ( [ 'zrevrank(key8, "member5")' , 1 ] ) ;
1139
+ baseTransaction . zrevrank ( key8 , "infMember" ) ;
1140
+ responseData . push ( [ 'zrevrank(key8, "infMember")' , 0 ] ) ;
1130
1141
1131
1142
if ( ! cluster . checkIfServerVersionLessThan ( "7.2.0" ) ) {
1132
1143
baseTransaction . zrevrankWithScore ( key8 , "member5" ) ;
1133
- responseData . push ( [ 'zrevrankWithScore(key8, "member5")' , [ 0 , 5 ] ] ) ;
1144
+ responseData . push ( [ 'zrevrankWithScore(key8, "member5")' , [ 1 , 5 ] ] ) ;
1145
+ baseTransaction . zrevrankWithScore ( key8 , "infMember" ) ;
1146
+ responseData . push ( [
1147
+ 'zrevrankWithScore(key8, "infMember")' ,
1148
+ [ 0 , Infinity ] ,
1149
+ ] ) ;
1134
1150
}
1135
1151
1136
1152
baseTransaction . zaddIncr ( key8 , member2 , 1 ) ;
@@ -1140,28 +1156,34 @@ export async function transactionTest(
1140
1156
baseTransaction . zrem ( key8 , [ member1 ] ) ;
1141
1157
responseData . push ( [ 'zrem(key8, ["member1"])' , 1 ] ) ;
1142
1158
baseTransaction . zcard ( key8 ) ;
1143
- responseData . push ( [ "zcard(key8)" , 4 ] ) ;
1159
+ responseData . push ( [ "zcard(key8)" , 6 ] ) ;
1144
1160
1145
1161
baseTransaction . zscore ( key8 , member2 ) ;
1146
1162
responseData . push ( [ 'zscore(key8, "member2")' , 3.0 ] ) ;
1163
+ baseTransaction . zscore ( key8 , "infMember" ) ;
1164
+ responseData . push ( [ 'zscore(key8, "infMember")' , Infinity ] ) ;
1147
1165
baseTransaction . zrange ( key8 , { start : 0 , end : - 1 } ) ;
1148
1166
responseData . push ( [
1149
1167
"zrange(key8, { start: 0, end: -1 })" ,
1150
1168
[
1169
+ "negInfMember" ,
1151
1170
member2 . toString ( ) ,
1152
1171
member3 . toString ( ) ,
1153
1172
member4 . toString ( ) ,
1154
1173
member5 . toString ( ) ,
1174
+ "infMember" ,
1155
1175
] ,
1156
1176
] ) ;
1157
1177
baseTransaction . zrangeWithScores ( key8 , { start : 0 , end : - 1 } ) ;
1158
1178
responseData . push ( [
1159
1179
"zrangeWithScores(key8, { start: 0, end: -1 })" ,
1160
1180
convertRecordToGlideRecord ( {
1181
+ negInfMember : - Infinity ,
1161
1182
member2 : 3 ,
1162
1183
member3 : 3.5 ,
1163
1184
member4 : 4 ,
1164
1185
member5 : 5 ,
1186
+ infMember : Infinity ,
1165
1187
} ) ,
1166
1188
] ) ;
1167
1189
baseTransaction . zadd ( key12 , [
@@ -1202,7 +1224,7 @@ export async function transactionTest(
1202
1224
baseTransaction . zrangeStore ( key8 , key8 , { start : 0 , end : - 1 } ) ;
1203
1225
responseData . push ( [
1204
1226
"zrangeStore(key8, key8, { start: 0, end: -1 })" ,
1205
- 4 ,
1227
+ 6 ,
1206
1228
] ) ;
1207
1229
baseTransaction . zdiff ( [ key13 , key12 ] ) ;
1208
1230
responseData . push ( [ "zdiff([key13, key12])" , [ "three" ] ] ) ;
@@ -1258,7 +1280,7 @@ export async function transactionTest(
1258
1280
baseTransaction . zcount ( key8 , { value : 2 } , InfBoundary . PositiveInfinity ) ;
1259
1281
responseData . push ( [
1260
1282
"zcount(key8, { value: 2 }, InfBoundary.PositiveInfinity)" ,
1261
- 4 ,
1283
+ 5 ,
1262
1284
] ) ;
1263
1285
baseTransaction . zlexcount (
1264
1286
key8 ,
@@ -1267,17 +1289,17 @@ export async function transactionTest(
1267
1289
) ;
1268
1290
responseData . push ( [
1269
1291
'zlexcount(key8, { value: "a" }, InfBoundary.PositiveInfinity)' ,
1270
- 4 ,
1292
+ 6 ,
1271
1293
] ) ;
1272
1294
baseTransaction . zpopmin ( key8 ) ;
1273
1295
responseData . push ( [
1274
1296
"zpopmin(key8)" ,
1275
- convertRecordToGlideRecord ( { member2 : 3.0 } ) ,
1297
+ convertRecordToGlideRecord ( { negInfMember : - Infinity } ) ,
1276
1298
] ) ;
1277
1299
baseTransaction . zpopmax ( key8 ) ;
1278
1300
responseData . push ( [
1279
1301
"zpopmax(key8)" ,
1280
- convertRecordToGlideRecord ( { member5 : 5 } ) ,
1302
+ convertRecordToGlideRecord ( { infMember : Infinity } ) ,
1281
1303
] ) ;
1282
1304
baseTransaction . zadd ( key8 , [ { element : member6 , score : 6 } ] ) ;
1283
1305
responseData . push ( [ "zadd(key8, {member6: 6})" , 1 ] ) ;
@@ -1300,7 +1322,7 @@ export async function transactionTest(
1300
1322
InfBoundary . NegativeInfinity ,
1301
1323
InfBoundary . PositiveInfinity ,
1302
1324
) ;
1303
- responseData . push ( [ "zremRangeByScore(key8, -Inf, +Inf)" , 1 ] ) ; // key8 is now empty
1325
+ responseData . push ( [ "zremRangeByScore(key8, -Inf, +Inf)" , 3 ] ) ; // key8 is now empty
1304
1326
baseTransaction . zremRangeByLex (
1305
1327
key8 ,
1306
1328
InfBoundary . NegativeInfinity ,
0 commit comments