diff --git a/packages/thing-contract/test/names.test.ts b/packages/thing-contract/test/names.test.ts index 0fa2e55..3af9083 100644 --- a/packages/thing-contract/test/names.test.ts +++ b/packages/thing-contract/test/names.test.ts @@ -1,6 +1,6 @@ // The type names the package gives its codecs are the C# package's (tests/thing-contract-parity), and the member names // follow the owner's: Rust names that C# flattens into arm classes have one codec per arm, a list slot names -// IReadOnlyList, and TextInputNode's slot 2 is inputKind, the camelCase of C# InputKind. +// ImmutableArray, and TextInputNode's slot 2 is inputKind, the camelCase of C# InputKind. import assert from "node:assert/strict"; import { join } from "node:path"; import test from "node:test"; @@ -35,13 +35,13 @@ test("Scalar is a Rust name the C# package does not have; ParamName is its type } }); -test("a list slot is named IReadOnlyList, never List, and the element is a type of the C# package", () => { +test("a list slot is named ImmutableArray, never List, and the element is a type of the C# package", () => { let lists = 0; for (const [key, codec] of entries) { for (const member of codec.members ?? []) { - if (!/List$/u.exec(member.typeName); + const element = /^System\.Collections\.Immutable\.ImmutableArray<(.+)>$/u.exec(member.typeName); assert.ok(element !== null, `${key}: ${member.typeName}`); assert.ok(element[1] === "System.String" || names.has(element[1]), `${key}: ${member.typeName}`); }