From a873d8a4cb160197cfacf10012b3905171451ece Mon Sep 17 00:00:00 2001 From: Yusuke Sakurai Date: Sat, 11 Apr 2020 15:34:45 +0900 Subject: [PATCH] bump: deno@v0.40.0 (#70) --- .denov | 2 +- .github/workflows/build.yml | 7 +- .github/workflows/bump.yml | 2 +- command.ts | 60 +++++++------- io.ts | 5 +- modules-lock.json | 2 +- modules.json | 4 +- pipeline.ts | 4 +- pipeline_test.ts | 20 ++--- pubsub.ts | 4 +- pubsub_test.ts | 12 +-- redis.ts | 80 +++++++++---------- tests/general_test.ts | 2 +- tests/geo_test.ts | 16 ++-- tests/hash_test.ts | 2 +- tests/sorted_set_test.ts | 38 ++++----- tests/string_test.ts | 8 +- tests/test_util.ts | 2 +- vendor/https/deno.land/std/fmt/colors.ts | 2 +- vendor/https/deno.land/std/io/bufio.ts | 2 +- vendor/https/deno.land/std/testing/asserts.ts | 2 +- vendor/https/deno.land/std/util/async.ts | 2 +- 22 files changed, 140 insertions(+), 138 deletions(-) diff --git a/.denov b/.denov index 99988914..707d5fac 100644 --- a/.denov +++ b/.denov @@ -1 +1 @@ -v0.39.0 \ No newline at end of file +v0.40.0 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 075ee427..9d233b69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,9 +19,10 @@ jobs: - uses: actions/checkout@v1 - name: Install Deno run: | - DENO_VERSION=$(cat .denov) - curl -fsSL https://deno.land/x/install/install.sh | bash -s -- ${DENO_VERSION} + echo "::set-env name=DENO_VERSION::$(cat .denov)" + - uses: denolib/setup-deno@master + with: + deno-version: ${{ env.DENO_VERSION }} - name: Run Tests run: | - export PATH=$HOME/.local/bin:$PATH make test diff --git a/.github/workflows/bump.yml b/.github/workflows/bump.yml index 4e214ccd..56a00f4e 100644 --- a/.github/workflows/bump.yml +++ b/.github/workflows/bump.yml @@ -16,7 +16,7 @@ jobs: - 6379:6379 steps: - uses: actions/checkout@v1 - - uses: keroxp/dink-bot@v1 + - uses: keroxp/dink-bot@master with: github-repository: ${{ github.repository }} github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/command.ts b/command.ts index bf7dedd5..120f9e9e 100644 --- a/command.ts +++ b/command.ts @@ -34,7 +34,7 @@ export type RedisCommands = { copy?: boolean; replace?: boolean; keys?: string[]; - }, + } ): Promise; move(key: string, db: string): Promise; object_refcount(key: string): Promise; @@ -54,7 +54,7 @@ export type RedisCommands = { key: string, ttl: number, serialized_value: string, - replace?: boolean, + replace?: boolean ): Promise; sort( @@ -66,7 +66,7 @@ export type RedisCommands = { patterns?: string[]; order: "ASC" | "DESC"; alpha?: boolean; - }, + } ): Promise; sort( @@ -79,7 +79,7 @@ export type RedisCommands = { order: "ASC" | "DESC"; alpha?: boolean; destination: string; - }, + } ): Promise; touch(...keys: string[]): Promise; @@ -111,7 +111,7 @@ export type RedisCommands = { key: string, bit: number, start?: number, - end?: number, + end?: number ): Promise; decr(key: string): Promise; decrby(key: string, decrement: number): Promise; @@ -130,7 +130,7 @@ export type RedisCommands = { opts?: { ex?: number; px?: number; - }, + } ): Promise; set( key: string, @@ -139,7 +139,7 @@ export type RedisCommands = { ex?: number; px?: number; mode: "NX" | "XX"; - }, + } ): Promise; setbit(key: string, offset: number, value: string): Promise; setex(key: string, seconds: number, value: string): Promise; @@ -155,7 +155,7 @@ export type RedisCommands = { key: string, longitude: number, latitude: number, - member: string, + member: string ): Promise; geoadd( key: string, @@ -169,7 +169,7 @@ export type RedisCommands = { key: string, member1: string, member2: string, - unit?: "m" | "km" | "ft" | "mi", + unit?: "m" | "km" | "ft" | "mi" ): Promise; // FIXME: Return type is too conditional georadius( @@ -186,7 +186,7 @@ export type RedisCommands = { sort?: "ASC" | "DESC"; store?: string; storeDist?: string; - }, + } ): Promise; // FIXME: Return type is too conditional georadiusbymember( @@ -202,7 +202,7 @@ export type RedisCommands = { sort?: "ASC" | "DESC"; store?: string; storeDist?: string; - }, + } ): Promise; // Hash hdel(key: string, ...fields: string[]): Promise; @@ -231,14 +231,14 @@ export type RedisCommands = { brpoplpush( source: string, destination: string, - timeout: number, + timeout: number ): Promise; lindex(key: string, index: number): Promise; linsert( key: string, loc: "BEFORE" | "AFTER", pivot: string, - value: string, + value: string ): Promise; llen(key: string): Promise; lpop(key: string): Promise; @@ -300,7 +300,7 @@ export type RedisCommands = { nxx?: "NX" | "XX"; ch?: boolean; incr?: boolean; - }, + } ): Promise; zadd( key: string, @@ -309,7 +309,7 @@ export type RedisCommands = { nxx?: "NX" | "XX"; ch?: boolean; incr?: boolean; - }, + } ): Promise; zcard(key: string): Promise; zcount(key: string, min: number, max: number): Promise; @@ -319,7 +319,7 @@ export type RedisCommands = { numkeys: number, keys: string | string[], weights?: number | number[], - aggregate?: "SUM" | "MIN" | "MAX", + aggregate?: "SUM" | "MIN" | "MAX" ): Promise; zlexcount(key: string, min: string, max: string): Promise; zpopmax(key: string, count?: number): Promise; @@ -330,7 +330,7 @@ export type RedisCommands = { stop: number, opts?: { withScore?: boolean; - }, + } ): Promise; zrangebylex( key: string, @@ -339,7 +339,7 @@ export type RedisCommands = { opts?: { offset?: number; count?: number; - }, + } ): Promise; zrevrangebylex( key: string, @@ -348,7 +348,7 @@ export type RedisCommands = { opts?: { offset?: number; count?: number; - }, + } ): Promise; zrangebyscore( key: string, @@ -358,7 +358,7 @@ export type RedisCommands = { withScore?: boolean; offset?: number; count?: number; - }, + } ): Promise; zrank(key: string, member: string): Promise; zrem(key: string, ...members: string[]): Promise; @@ -371,7 +371,7 @@ export type RedisCommands = { stop: number, opts?: { withScore?: boolean; - }, + } ): Promise; zrevrangebyscore( key: string, @@ -381,7 +381,7 @@ export type RedisCommands = { withScore?: boolean; offset?: number; count?: number; - }, + } ): Promise; zrevrank(key: string, member: string): Promise; zscore(key: string, member: string): Promise; @@ -391,7 +391,7 @@ export type RedisCommands = { opts?: { weights?: number[]; aggregate?: "SUM" | "MIN" | "MAX"; - }, + } ): Promise; // Cluster // cluster // @@ -411,7 +411,7 @@ export type RedisCommands = { Integer, Integer, Integer, - [BulkString[]], + [BulkString[]] ] | BulkNil]>; config_get(parameter: string): Promise; config_rewrite(): Promise; @@ -433,11 +433,11 @@ export type RedisCommands = { key: string, opts?: { samples?: number; - }, + } ): Promise; monitor(): void; role(): Promise< - | ["master", Integer, BulkString[][]] + ["master", Integer, BulkString[][]] | ["slave", BulkString, Integer, BulkString, Integer] | ["sentinel", BulkString[]] >; @@ -475,7 +475,7 @@ export type RedisCommands = { opts?: { pattern?: string; count?: number; - }, + } ): Promise<[BulkString, BulkString[]]>; hscan( key: string, @@ -483,7 +483,7 @@ export type RedisCommands = { opts?: { pattern?: string; count?: number; - }, + } ): Promise<[BulkString, BulkString[]]>; sscan( key: string, @@ -491,14 +491,14 @@ export type RedisCommands = { opts?: { pattern?: string; count?: number; - }, + } ): Promise<[BulkString, BulkString[]]>; zscan( key: string, cursor: number, opts?: { pattern?: string; - }, + } ): Promise<[BulkString, BulkString[]]>; readonly isClosed: boolean; diff --git a/io.ts b/io.ts index 491dfd15..878e0fc5 100644 --- a/io.ts +++ b/io.ts @@ -14,7 +14,8 @@ export type StatusReply = ["status", Status]; export type IntegerReply = ["integer", Integer]; export type BulkReply = ["bulk", Bulk]; export type ArrayReply = ["array", ConditionalArray]; -export type RedisRawReply = StatusReply | IntegerReply | BulkReply | ArrayReply; +export type RedisRawReply = StatusReply | IntegerReply | BulkReply + | ArrayReply; export type CommandFunc = ( comand: string, @@ -171,7 +172,7 @@ function tryParseErrorReply(line: string): never { export function muxExecutor( r: BufReader, - w: BufWriter, + w: BufWriter ): CommandExecutor { let queue: { command: string; diff --git a/modules-lock.json b/modules-lock.json index f967417b..54ba39d3 100644 --- a/modules-lock.json +++ b/modules-lock.json @@ -1,6 +1,6 @@ { "https://deno.land/std": { - "version": "@v0.39.0", + "version": "@v0.40.0", "modules": [ "/util/async.ts", "/testing/asserts.ts", diff --git a/modules.json b/modules.json index f967417b..ccb9ea50 100644 --- a/modules.json +++ b/modules.json @@ -1,6 +1,6 @@ { "https://deno.land/std": { - "version": "@v0.39.0", + "version": "@v0.40.0", "modules": [ "/util/async.ts", "/testing/asserts.ts", @@ -8,4 +8,4 @@ "/fmt/colors.ts" ] } -} \ No newline at end of file +} diff --git a/pipeline.ts b/pipeline.ts index 65c4a8d9..2934e34f 100644 --- a/pipeline.ts +++ b/pipeline.ts @@ -28,7 +28,7 @@ export type RedisPipeline = { export function createRedisPipeline( writer: BufWriter, reader: BufReader, - opts?: { tx: true }, + opts?: { tx: true } ): RedisPipeline { let commands: string[] = []; let queue: { @@ -108,6 +108,6 @@ function dummyReadWriteCloser(): Deno.ReadWriteCloser { }, async write(p) { return 0; - }, + } }; } diff --git a/pipeline_test.ts b/pipeline_test.ts index f88e087e..4c2deb61 100644 --- a/pipeline_test.ts +++ b/pipeline_test.ts @@ -3,7 +3,7 @@ import { connect } from "./redis.ts"; const test = Deno.test; const addr = { hostname: "127.0.0.1", - port: 6379, + port: 6379 }; test(async function testPipeline() { @@ -16,7 +16,7 @@ test(async function testPipeline() { pl.set("set2", "value2"), pl.mget("set1", "set2"), pl.del("set1"), - pl.del("set2"), + pl.del("set2") ]); const ret = await pl.flush(); assertEquals(ret, [ @@ -26,7 +26,7 @@ test(async function testPipeline() { ["status", "OK"], ["array", ["value1", "value2"]], ["integer", 1], - ["integer", 1], + ["integer", 1] ]); redis.close(); }); @@ -54,22 +54,22 @@ test(async function testTx() { tx3.incr("key"), tx3.incr("key"), tx3.incr("key"), - tx3.get("key"), + tx3.get("key") ]); const rep1 = await tx1.flush(); const rep2 = await tx2.flush(); const rep3 = await tx3.flush(); assertEquals( parseInt(rep1[4][1] as string), - parseInt(rep1[0][1] as string) + 3, + parseInt(rep1[0][1] as string) + 3 ); assertEquals( parseInt(rep2[4][1] as string), - parseInt(rep2[0][1] as string) + 3, + parseInt(rep2[0][1] as string) + 3 ); assertEquals( parseInt(rep3[4][1] as string), - parseInt(rep3[0][1] as string) + 3, + parseInt(rep3[0][1] as string) + 3 ); redis.close(); }); @@ -95,7 +95,7 @@ test("pipeline in concurrent", async () => { [ ["status", "OK"], ["status", "OK"], - ["status", "OK"], + ["status", "OK"] ], // flush() "OK", // get(a) "OK", // get(b) @@ -103,8 +103,8 @@ test("pipeline in concurrent", async () => { [ ["bulk", "a"], ["bulk", "b"], - ["bulk", "c"], - ], // flush() + ["bulk", "c"] + ] // flush() ]); redis.close(); }); diff --git a/pubsub.ts b/pubsub.ts index fac78d2d..c5e1d75b 100644 --- a/pubsub.ts +++ b/pubsub.ts @@ -66,13 +66,13 @@ class RedisSubscriptionImpl implements RedisSubscription { if (ev === "message" && rep.length === 3) { yield { channel: rep[1], - message: rep[2], + message: rep[2] }; } else if (ev === "pmessage" && rep.length === 4) { yield { pattern: rep[1], channel: rep[2], - message: rep[3], + message: rep[3] }; } } diff --git a/pubsub_test.ts b/pubsub_test.ts index 7498b164..ecde6503 100644 --- a/pubsub_test.ts +++ b/pubsub_test.ts @@ -3,7 +3,7 @@ import { connect } from "./redis.ts"; const { test } = Deno; const addr = { hostname: "127.0.0.1", - port: 6379, + port: 6379 }; async function wait(duration: number) { @@ -26,7 +26,7 @@ test(async function testSubscribe2() { const redis = await connect(addr); const pub = await connect(addr); const sub = await redis.subscribe("subsc2"); - const p = (async function () { + const p = (async function() { const it = sub.receive(); return (await it.next()).value; })(); @@ -34,7 +34,7 @@ test(async function testSubscribe2() { const message = await p; assertEquals(message, { channel: "subsc2", - message: "wayway", + message: "wayway" }); await sub.close(); const a = await redis.get("aaa"); @@ -50,7 +50,7 @@ test(async function testPsubscribe() { let message1; let message2; const it = sub.receive(); - const p = (async function () { + const p = (async function() { message1 = (await it.next()).value; message2 = (await it.next()).value; })(); @@ -60,12 +60,12 @@ test(async function testPsubscribe() { assertEquals(message1, { pattern: "ps*", channel: "psub", - message: "wayway", + message: "wayway" }); assertEquals(message2, { pattern: "ps*", channel: "psubs", - message: "heyhey", + message: "heyhey" }); await sub.close(); pub.close(); diff --git a/redis.ts b/redis.ts index 988a83a9..16f07504 100644 --- a/redis.ts +++ b/redis.ts @@ -36,7 +36,7 @@ class RedisImpl implements RedisCommands { private closer: Closer, private writer: BufWriter, private reader: BufReader, - readonly executor: CommandExecutor, + readonly executor: CommandExecutor ) { } @@ -216,7 +216,7 @@ class RedisImpl implements RedisCommands { Integer, Integer, Integer, - [BulkString[]], + [BulkString[]] ] | BulkNil] >; } @@ -285,7 +285,7 @@ class RedisImpl implements RedisCommands { cmd: string, script: string, keys: string | string[], - args: string | string[], + args: string | string[] ) { const _args = [script]; if (typeof keys === "string") { @@ -347,7 +347,7 @@ class RedisImpl implements RedisCommands { return this.execArrayReply<[number, number] | undefined>( "GEOPOS", key, - ...members, + ...members ); } @@ -373,11 +373,11 @@ class RedisImpl implements RedisCommands { sort?: "ASC" | "DESC"; store?: string; storeDist?: string; - }, + } ) { const args = this.pushGeoRadiusOpts( [key, longitude, latitude, radius, unit], - opts, + opts ); return this.execArrayReply("GEORADIUS", ...args); } @@ -395,7 +395,7 @@ class RedisImpl implements RedisCommands { sort?: "ASC" | "DESC"; store?: string; storeDist?: string; - }, + } ) { const args = this.pushGeoRadiusOpts([key, member, radius, unit], opts); return this.execArrayReply("GEORADIUSBYMEMBER", ...args); @@ -411,7 +411,7 @@ class RedisImpl implements RedisCommands { sort?: "ASC" | "DESC"; store?: string; storeDist?: string; - }, + } ) { if (!opts) return args; if (opts.withCoord) { @@ -479,7 +479,7 @@ class RedisImpl implements RedisCommands { "HINCRBYFLOAT", key, field, - increment, + increment ); } @@ -607,7 +607,7 @@ class RedisImpl implements RedisCommands { key: string, opts?: { samples?: number; - }, + } ) { const args: (number | string)[] = [key]; if (opts && typeof opts.samples === "number") { @@ -630,7 +630,7 @@ class RedisImpl implements RedisCommands { copy?: boolean; replace?: boolean; keys?: string[]; - }, + } ) { const args = [host, port, key, destination_db, timeout]; if (opts) { @@ -749,7 +749,7 @@ class RedisImpl implements RedisCommands { const arr = await this.execArrayReply( "PUBSUB", "NUMSUBS", - ...channels, + ...channels ); const ret: [string, number][] = []; for (let i = 0; i < arr.length; i += 2) { @@ -795,7 +795,7 @@ class RedisImpl implements RedisCommands { key: string, ttl: number, serialized_value: string, - REPLACE?: boolean, + REPLACE?: boolean ) { const args = [key, ttl, serialized_value]; if (REPLACE) { @@ -806,7 +806,7 @@ class RedisImpl implements RedisCommands { role() { return this.execArrayReply("ROLE") as Promise< - | ["master", Integer, BulkString[][]] + ["master", Integer, BulkString[][]] | ["slave", BulkString, Integer, BulkString, Integer] | ["sentinel", BulkString[]] >; @@ -878,7 +878,7 @@ class RedisImpl implements RedisCommands { opts?: { ex?: number; px?: number; - }, + } ): Promise; set( key: string, @@ -887,7 +887,7 @@ class RedisImpl implements RedisCommands { ex?: number; px?: number; mode: "NX" | "XX"; - }, + } ): Promise; set( key: string, @@ -896,7 +896,7 @@ class RedisImpl implements RedisCommands { ex?: number; px?: number; mode?: "NX" | "XX"; - }, + } ) { const args: (number | string)[] = [key, value]; if (opts) { @@ -977,7 +977,7 @@ class RedisImpl implements RedisCommands { patterns?: string[]; order: "ASC" | "DESC"; alpha?: boolean; - }, + } ): Promise; sort( @@ -990,7 +990,7 @@ class RedisImpl implements RedisCommands { order: "ASC" | "DESC"; alpha?: boolean; destination: string; - }, + } ): Promise; sort( key: string, @@ -1002,7 +1002,7 @@ class RedisImpl implements RedisCommands { order: "ASC" | "DESC"; alpha?: boolean; destination?: string; - }, + } ) { const args: (number | string)[] = [key]; if (opts) { @@ -1153,13 +1153,13 @@ class RedisImpl implements RedisCommands { numkeys: number, keys: string[], weights?: number | number[], - aggregate?: string, + aggregate?: string ) { const args = this.pushZInterStoreArgs( [destination, numkeys], keys, weights, - aggregate, + aggregate ); return this.execIntegerReply("ZINTERSTORE", ...args); } @@ -1170,7 +1170,7 @@ class RedisImpl implements RedisCommands { opts?: { weights?: number[]; aggregate?: "SUM" | "MIN" | "MAX"; - }, + } ) { const args: (string | number)[] = [destination, keys.length, ...keys]; if (opts) { @@ -1188,7 +1188,7 @@ class RedisImpl implements RedisCommands { args: (number | string)[], keys: string | string[], weights?: number | number[], - aggregate?: string, + aggregate?: string ) { if (typeof keys === "string") { args.push(keys); @@ -1236,7 +1236,7 @@ class RedisImpl implements RedisCommands { stop: number, opts?: { withScore?: boolean; - }, + } ) { const args = this.pushZrangeOpts([key, start, stop], opts); return this.execArrayReply("ZRANGE", ...args); @@ -1249,7 +1249,7 @@ class RedisImpl implements RedisCommands { opts?: { withScore?: boolean; count?: number; - }, + } ) { const args = this.pushZrangeOpts([key, min, max], opts); return this.execArrayReply("ZRANGEBYLEX", ...args); @@ -1262,7 +1262,7 @@ class RedisImpl implements RedisCommands { opts?: { withScore?: boolean; count?: number; - }, + } ) { const args = this.pushZrangeOpts([key, min, max], opts); return this.execArrayReply("ZREVRANGEBYLEX", ...args); @@ -1275,7 +1275,7 @@ class RedisImpl implements RedisCommands { opts?: { withScore?: boolean; count?: number; - }, + } ) { const args = this.pushZrangeOpts([key, min, max], opts); return this.execArrayReply("ZRANGEBYSCORE", ...args); @@ -1287,7 +1287,7 @@ class RedisImpl implements RedisCommands { withScore?: boolean; offset?: number; count?: number; - }, + } ) { if (opts) { if (opts.withScore) { @@ -1326,7 +1326,7 @@ class RedisImpl implements RedisCommands { stop: number, opts?: { withScore?: boolean; - }, + } ) { const args = this.pushZrangeOpts([key, start, stop], opts); return this.execArrayReply("ZREVRANGE", ...args); @@ -1340,7 +1340,7 @@ class RedisImpl implements RedisCommands { withScore?: boolean; offset?: number; count?: number; - }, + } ) { const args = this.pushZrangeOpts([key, max, min], opts); return this.execArrayReply("ZREVRANGEBYSCORE", ...args); @@ -1359,7 +1359,7 @@ class RedisImpl implements RedisCommands { opts?: { pattern?: string; count?: number; - }, + } ) { const arg = this.pushScanOpts([cursor], opts); return this.execArrayReply("SCAN", ...arg) as Promise< @@ -1373,7 +1373,7 @@ class RedisImpl implements RedisCommands { opts?: { pattern?: string; count?: number; - }, + } ) { const arg = this.pushScanOpts([key, cursor], opts); return this.execArrayReply("SSCAN", ...arg) as Promise< @@ -1387,7 +1387,7 @@ class RedisImpl implements RedisCommands { opts?: { pattern?: string; count?: number; - }, + } ) { const arg = this.pushScanOpts([key, cursor], opts); return this.execArrayReply("HSCAN", ...arg) as Promise< @@ -1400,7 +1400,7 @@ class RedisImpl implements RedisCommands { cursor: number, opts?: { pattern?: string; - }, + } ) { const arg = this.pushScanOpts([key, cursor], opts); return this.execArrayReply("ZSCAN", ...arg) as Promise< @@ -1413,7 +1413,7 @@ class RedisImpl implements RedisCommands { opts?: { pattern?: string; count?: number; - }, + } ) { if (opts) { if (opts.pattern) { @@ -1472,11 +1472,11 @@ export async function connect({ hostname, port, tls, - db, + db }: RedisConnectOptions): Promise { const dialOpts: Deno.ConnectOptions = { hostname, - port: prasePortLike(port), + port: prasePortLike(port) }; if (!Number.isSafeInteger(dialOpts.port)) { throw new Error("deno-redis: opts.port is invalid"); @@ -1499,12 +1499,12 @@ export function create( closer: Closer, writer: Writer, reader: Reader, - executor: CommandExecutor, + executor: CommandExecutor ): Redis { return new RedisImpl( closer, new BufWriter(writer), new BufReader(reader), - executor, + executor ); } diff --git a/tests/general_test.ts b/tests/general_test.ts index 568631f4..22eaba64 100644 --- a/tests/general_test.ts +++ b/tests/general_test.ts @@ -59,7 +59,7 @@ test("exists", async function testDb1Option() { test("execRawReply", async () => { assertEquals( await redis.executor.exec("SET", "key", "a"), - ["status", "OK"], + ["status", "OK"] ); assertEquals(await redis.executor.exec("GET", "key"), ["bulk", "a"]); }); diff --git a/tests/geo_test.ts b/tests/geo_test.ts index f60b8b67..525b16b7 100644 --- a/tests/geo_test.ts +++ b/tests/geo_test.ts @@ -8,19 +8,19 @@ const { test, client } = await makeTest("geo"); test("geoadd", async () => { assertEquals( await client.geoadd("Sicily", 13.361389, 38.115556, "Palermo"), - 1, + 1 ); assertEquals( await client.geoadd("Sicily", 15.087269, 37.502669, "Catania"), - 1, + 1 ); assertEquals( await client.geoadd( "Sicily", [13.361389, 38.115556, "Palermo"], - [15.087269, 37.502669, "Catania"], + [15.087269, 37.502669, "Catania"] ), - 0, + 0 ); }); @@ -28,7 +28,7 @@ test("geohash", async () => { await client.geoadd( "Sicily", [13.361389, 38.115556, "Palermo"], - [15.087269, 37.502669, "Catania"], + [15.087269, 37.502669, "Catania"] ); const resp = await client.geohash("Sicily", "Palermo", "Catania", "Enna"); assertEquals(resp, ["sqc8b49rny0", "sqdtr74hyu0", undefined]); @@ -38,13 +38,13 @@ test("geopos", async () => { await client.geoadd( "Sicily", [13.361389, 38.115556, "Palermo"], - [15.087269, 37.502669, "Catania"], + [15.087269, 37.502669, "Catania"] ); const resp = await client.geopos("Sicily", "Palermo", "Catania", "Enna"); assertEquals(resp, [ ["13.36138933897018433", "38.11555639549629859"], ["15.08726745843887329", "37.50266842333162032"], - [], + [] ]); }); @@ -52,7 +52,7 @@ test("geodist", async () => { await client.geoadd( "Sicily", [13.361389, 38.115556, "Palermo"], - [15.087269, 37.502669, "Catania"], + [15.087269, 37.502669, "Catania"] ); let resp = await client.geodist("Sicily", "Palermo", "Catania"); assertEquals(resp, "166274.1516"); diff --git a/tests/hash_test.ts b/tests/hash_test.ts index e966ced6..7507976c 100644 --- a/tests/hash_test.ts +++ b/tests/hash_test.ts @@ -49,7 +49,7 @@ test("hmget", async () => { assertEquals(await client.hmget("key", "f1", "f2", "f3"), [ "1", "2", - undefined, + undefined ]); }); test("hmset", async () => { diff --git a/tests/sorted_set_test.ts b/tests/sorted_set_test.ts index 32647db4..ec0878fa 100644 --- a/tests/sorted_set_test.ts +++ b/tests/sorted_set_test.ts @@ -10,7 +10,7 @@ const { test, client } = await makeTest("zet"); test("bzpopmin", async () => { await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]); assertEquals(await client.bzpopmin("key", 1), ["key", "1", "1"]); }); @@ -23,7 +23,7 @@ test("bzpopmin timeout", async () => { test("bzpopmax", async () => { await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]); assertEquals(await client.bzpopmax("key", 1), ["key", "2", "2"]); }); @@ -36,21 +36,21 @@ test("bzpopmax timeout", async () => { test("zadd", async () => { assertEquals(await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]), 2); }); test("zcount", async () => { await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]); assertEquals(await client.zcount("key", 0, 1), 1); }); test("zincrby", async () => { await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]); const v = await client.zincrby("key", 2.0, "1"); assert(v != null); @@ -60,11 +60,11 @@ test("zincrby", async () => { test("zinterstore", async () => { await client.zadd("key", [ [1, "1"], - [2, "2"], + [2, "2"] ]); await client.zadd("key2", [ [1, "1"], - [3, "3"], + [3, "3"] ]); assertEquals(await client.zinterstore("dest", 2, ["key", "key2"]), 1); }); @@ -72,7 +72,7 @@ test("zinterstore", async () => { test("zlexcount", async () => { await client.zadd("key2", [ [1, "1"], - [2, "2"], + [2, "2"] ]); assertEquals(await client.zlexcount("key", "-", "(2"), 0); }); @@ -80,7 +80,7 @@ test("zlexcount", async () => { test("zpopmax", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zpopmax("key", 1), ["two", "2"]); }); @@ -88,7 +88,7 @@ test("zpopmax", async () => { test("zrange", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zrange("key", 1, 2), ["two"]); }); @@ -96,7 +96,7 @@ test("zrange", async () => { test("zrangebylex", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zrangebylex("key", "-", "(2"), []); }); @@ -104,7 +104,7 @@ test("zrangebylex", async () => { test("zrevrangebylex", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zrevrangebylex("key", "(2", "-"), []); }); @@ -112,7 +112,7 @@ test("zrevrangebylex", async () => { test("zrangebyscore", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zrangebyscore("key", "1", "2"), ["one", "two"]); }); @@ -120,7 +120,7 @@ test("zrangebyscore", async () => { test("zrank", async () => { await client.zadd("key", [ [1, "one"], - [2, "two"], + [2, "two"] ]); assertEquals(await client.zrank("key", "two"), 1); }); @@ -166,7 +166,7 @@ test("zscan", async () => { client.zadd("key", [[1, "one"], [2, "two"]]); assertEquals(await client.zscan("key", 1), [ "0", - ["one", "1", "two", "2"], + ["one", "1", "two", "2"] ]); }); @@ -199,7 +199,7 @@ test("testZrevrangeWithScores", async function testZrevrangeWithScores() { client.zadd("zrevrangeWithScores", 2, "two"); client.zadd("zrevrangeWithScores", 3, "three"); const v = await client.zrevrange("zrevrangeWithScores", 0, 1, { - withScore: true, + withScore: true }); assertEquals(v, ["three", "3", "two", "2"]); }); @@ -221,10 +221,10 @@ test( client.zadd("zrangebyscoreWithScores", 8, "m3"); client.zadd("zrangebyscoreWithScores", 10, "m4"); const v = await client.zrangebyscore("zrangebyscoreWithScores", 3, 9, { - withScore: true, + withScore: true }); assertEquals(v, ["m2", "5", "m3", "8"]); - }, + } ); test("testZrevrangebyscore", async function testZrevrangebyscore() { @@ -242,7 +242,7 @@ test("testZrevrangebyscore", async function testZrevrangebyscore() { client.zadd("zrevrangebyscoreWithScores", 8, "m3"); client.zadd("zrevrangebyscoreWithScores", 10, "m4"); const v = await client.zrevrangebyscore("zrevrangebyscoreWithScores", 9, 4, { - withScore: true, + withScore: true }); assertEquals(v, ["m3", "8", "m2", "5"]); }); diff --git a/tests/string_test.ts b/tests/string_test.ts index 69f1aff9..981e085f 100644 --- a/tests/string_test.ts +++ b/tests/string_test.ts @@ -30,14 +30,14 @@ test("bitfield with opts", async () => { const v = await client.bitfield("key", { get: { type: "u8", offset: 0 }, set: { type: "i5", offset: 1, value: 0 }, - incrby: { type: "u16", offset: 2, increment: 2 }, + incrby: { type: "u16", offset: 2, increment: 2 } }); assertEquals(v, [52, 13, 218]); }); test("bitfield with overflow", async () => { const v = await client.bitfield("key", { - overflow: "FAIL", + overflow: "FAIL" }); assertEquals(v, []); }); @@ -154,11 +154,11 @@ test("setbit", async () => { await client.set("key", "2"); // 00110010 assertEquals( 0, - await client.setbit("key", 1, "1"), // 01110010 + await client.setbit("key", 1, "1") // 01110010 ); assertEquals( 1, - await client.setbit("key", 3, "0"), // 01100010 => b + await client.setbit("key", 3, "0") // 01100010 => b ); const v = await client.get("key"); assertEquals(v, "b"); diff --git a/tests/test_util.ts b/tests/test_util.ts index 66e0be06..f1180280 100644 --- a/tests/test_util.ts +++ b/tests/test_util.ts @@ -17,7 +17,7 @@ function db(): number { } export async function makeTest( - prefix: string, + prefix: string ): Promise<{ client: Redis; opts: RedisConnectOptions; diff --git a/vendor/https/deno.land/std/fmt/colors.ts b/vendor/https/deno.land/std/fmt/colors.ts index 2c464d16..05f2d2c9 100644 --- a/vendor/https/deno.land/std/fmt/colors.ts +++ b/vendor/https/deno.land/std/fmt/colors.ts @@ -1 +1 @@ -export * from "https://deno.land/std@v0.39.0/fmt/colors.ts"; +export * from "https://deno.land/std@v0.40.0/fmt/colors.ts"; diff --git a/vendor/https/deno.land/std/io/bufio.ts b/vendor/https/deno.land/std/io/bufio.ts index 075510a5..c044b979 100644 --- a/vendor/https/deno.land/std/io/bufio.ts +++ b/vendor/https/deno.land/std/io/bufio.ts @@ -1 +1 @@ -export * from "https://deno.land/std@v0.39.0/io/bufio.ts"; +export * from "https://deno.land/std@v0.40.0/io/bufio.ts"; diff --git a/vendor/https/deno.land/std/testing/asserts.ts b/vendor/https/deno.land/std/testing/asserts.ts index 90fc9a42..e0ba8d21 100644 --- a/vendor/https/deno.land/std/testing/asserts.ts +++ b/vendor/https/deno.land/std/testing/asserts.ts @@ -1 +1 @@ -export * from "https://deno.land/std@v0.39.0/testing/asserts.ts"; +export * from "https://deno.land/std@v0.40.0/testing/asserts.ts"; diff --git a/vendor/https/deno.land/std/util/async.ts b/vendor/https/deno.land/std/util/async.ts index b43aec57..ec08b73e 100644 --- a/vendor/https/deno.land/std/util/async.ts +++ b/vendor/https/deno.land/std/util/async.ts @@ -1 +1 @@ -export * from "https://deno.land/std@v0.39.0/util/async.ts"; +export * from "https://deno.land/std@v0.40.0/util/async.ts";