Skip to content

Commit

Permalink
chore: release 2024.10.10a (#6101)
Browse files Browse the repository at this point in the history
Co-authored-by: kt3k <[email protected]>
  • Loading branch information
denobot and kt3k authored Oct 10, 2024
1 parent b9e8edf commit 345e74f
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 47 deletions.
6 changes: 6 additions & 0 deletions Releases.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### 2024.10.10a

#### @std/cbor 0.1.1 (patch)

- fix(cbor): fix module specifier in import (#6099)

### 2024.10.10

#### @std/async 1.0.6 (patch)
Expand Down
2 changes: 1 addition & 1 deletion cbor/deno.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@std/cbor",
"version": "0.1.0",
"version": "0.1.1",
"exports": {
".": "./mod.ts",
"./array-encoder-stream": "./array_encoder_stream.ts",
Expand Down
96 changes: 51 additions & 45 deletions cbor/text_encoder_stream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,54 @@ import { random } from "./_common_test.ts";
import { encodeCbor } from "./encode_cbor.ts";
import { CborTextEncoderStream } from "./text_encoder_stream.ts";

Deno.test("CborTextEncoderStream() correctly encoding", async () => {
const strings = [
"a".repeat(random(0, 24)),
"a".repeat(random(24, 2 ** 8)),
"a".repeat(random(2 ** 8, 2 ** 16)),
"a".repeat(random(2 ** 16, 2 ** 16 + 1000)),
];

const expectedOutput = concat([
new Uint8Array([0b011_11111]),
...strings.filter((x) => x).map((x) => encodeCbor(x)),
new Uint8Array([0b111_11111]),
]);

const actualOutput = concat(
await Array.fromAsync(
ReadableStream.from(strings).pipeThrough(new CborTextEncoderStream()),
),
);

assertEquals(actualOutput, expectedOutput);
});

Deno.test("CborTextEncoderStream.from() correctly encoding", async () => {
const strings = [
"a".repeat(random(0, 24)),
"a".repeat(random(24, 2 ** 8)),
"a".repeat(random(2 ** 8, 2 ** 16)),
"a".repeat(random(2 ** 16, 2 ** 16 + 1000)),
];

const expectedOutput = concat([
new Uint8Array([0b011_11111]),
...strings.filter((x) => x).map((x) => encodeCbor(x)),
new Uint8Array([0b111_11111]),
]);

const actualOutput = concat(
await Array.fromAsync(
CborTextEncoderStream.from(strings).readable,
),
);

assertEquals(actualOutput, expectedOutput);
});
Deno.test(
"CborTextEncoderStream() correctly encoding",
{ ignore: true },
async () => {
const strings = [
"a".repeat(random(0, 24)),
"a".repeat(random(24, 2 ** 8)),
"a".repeat(random(2 ** 8, 2 ** 10)),
];

const expectedOutput = concat([
new Uint8Array([0b011_11111]),
...strings.filter((x) => x).map((x) => encodeCbor(x)),
new Uint8Array([0b111_11111]),
]);

const actualOutput = concat(
await Array.fromAsync(
ReadableStream.from(strings).pipeThrough(new CborTextEncoderStream()),
),
);

assertEquals(actualOutput, expectedOutput);
},
);

Deno.test(
"CborTextEncoderStream.from() correctly encoding",
{ ignore: true },
async () => {
const strings = [
"a".repeat(random(0, 24)),
"a".repeat(random(24, 2 ** 8)),
"a".repeat(random(2 ** 8, 2 ** 10)),
];

const expectedOutput = concat([
new Uint8Array([0b011_11111]),
...strings.filter((x) => x).map((x) => encodeCbor(x)),
new Uint8Array([0b111_11111]),
]);

const actualOutput = concat(
await Array.fromAsync(
CborTextEncoderStream.from(strings).readable,
),
);

assertEquals(actualOutput, expectedOutput);
},
);
2 changes: 1 addition & 1 deletion import_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@std/async": "jsr:@std/async@^1.0.6",
"@std/bytes": "jsr:@std/bytes@^1.0.2",
"@std/cache": "jsr:@std/cache@^0.1.3",
"@std/cbor": "jsr:@std/cbor@^0.1.0",
"@std/cbor": "jsr:@std/cbor@^0.1.1",
"@std/cli": "jsr:@std/cli@^1.0.6",
"@std/collections": "jsr:@std/collections@^1.0.8",
"@std/crypto": "jsr:@std/crypto@^1.0.3",
Expand Down

0 comments on commit 345e74f

Please sign in to comment.