Repairs to tests
This commit is contained in:
parent
6576f30639
commit
43f31b9a78
|
@ -28,7 +28,7 @@ expect.extend({
|
||||||
return { message: () => preserves`expected an exception not matching the filter`,
|
return { message: () => preserves`expected an exception not matching the filter`,
|
||||||
pass: true };
|
pass: true };
|
||||||
} else {
|
} else {
|
||||||
return { message: () => preserves`expected an exception matching the filter: ${e.constructor.name}`,
|
return { message: () => preserves`expected an exception matching the filter: ${(e as any)?.constructor?.name}`,
|
||||||
pass: false };
|
pass: false };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,8 +32,8 @@ describe('checker', () => {
|
||||||
definitions: {
|
definitions: {
|
||||||
ExtensibleRecord:
|
ExtensibleRecord:
|
||||||
<rec <lit foo>
|
<rec <lit foo>
|
||||||
<tuple* [<named a <atom String>>, <named b <atom String>>]
|
<tuplePrefix [<named a <atom String>>, <named b <atom String>>]
|
||||||
<named extra <seqof any>>>>}}>`).next());
|
<named extra <seqof any>>>>}}>`).next());
|
||||||
});
|
});
|
||||||
it('non-invertibility tail', () => {
|
it('non-invertibility tail', () => {
|
||||||
expect(() => readSchema(
|
expect(() => readSchema(
|
||||||
|
@ -51,11 +51,11 @@ describe('checker', () => {
|
||||||
expect(() => readSchema('version 1 . A = { x: @a string , y: @a string }.'))
|
expect(() => readSchema('version 1 . A = { x: @a string , y: @a string }.'))
|
||||||
.toThrow(/duplicate binding named "a" in entry y in dictionary in A/);
|
.toThrow(/duplicate binding named "a" in entry y in dictionary in A/);
|
||||||
});
|
});
|
||||||
it('complains about duplicates in tuple*s', () => {
|
it('complains about duplicates in tuplePrefixes', () => {
|
||||||
expect(() => readSchema('version 1 . A = [@a string @b string @a int @rest any ...].'))
|
expect(() => readSchema('version 1 . A = [@a string @b string @a int @rest any ...].'))
|
||||||
.toThrow(/duplicate binding named "a" in item 2 of A/);
|
.toThrow(/duplicate binding named "a" in item 2 of A/);
|
||||||
});
|
});
|
||||||
it('complains about duplicates in tuple* tails', () => {
|
it('complains about duplicates in tuplePrefix tails', () => {
|
||||||
expect(() => readSchema('version 1 . A = [@a string @b string @c int @a any ...].'))
|
expect(() => readSchema('version 1 . A = [@a string @b string @c int @a any ...].'))
|
||||||
.toThrow(/duplicate binding named "a" in tail of A/);
|
.toThrow(/duplicate binding named "a" in tail of A/);
|
||||||
});
|
});
|
||||||
|
@ -113,7 +113,7 @@ describe('checker', () => {
|
||||||
`version 1 .
|
`version 1 .
|
||||||
AAA = <a @a string @a int>.
|
AAA = <a @a string @a int>.
|
||||||
ABC = <a @b string @c int>.
|
ABC = <a @b string @c int>.
|
||||||
A = @x AAA & @y ABC.`))
|
A = @x AAA & @y ABC .`))
|
||||||
.toThrow(/in item 1 of fields of AAA/);
|
.toThrow(/in item 1 of fields of AAA/);
|
||||||
});
|
});
|
||||||
it('is OK with seeming- but non-duplicates across named branches', () => {
|
it('is OK with seeming- but non-duplicates across named branches', () => {
|
||||||
|
@ -121,7 +121,7 @@ describe('checker', () => {
|
||||||
`version 1 .
|
`version 1 .
|
||||||
AAA = <a @a string @b int>.
|
AAA = <a @a string @b int>.
|
||||||
ABC = <a @a string @c int>.
|
ABC = <a @a string @c int>.
|
||||||
A = @x AAA & @y ABC.`))
|
A = @x AAA & @y ABC .`))
|
||||||
.not.toBeNull();
|
.not.toBeNull();
|
||||||
});
|
});
|
||||||
it('complains about duplicate branch names', () => {
|
it('complains about duplicate branch names', () => {
|
||||||
|
@ -129,7 +129,7 @@ describe('checker', () => {
|
||||||
`version 1 .
|
`version 1 .
|
||||||
AAB = <a @a string @b int>.
|
AAB = <a @a string @b int>.
|
||||||
ACD = <a @c string @d int>.
|
ACD = <a @c string @d int>.
|
||||||
A = @x AAB & @x ACD.`))
|
A = @x AAB & @x ACD .`))
|
||||||
.toThrow(/in A/);
|
.toThrow(/in A/);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -27,7 +27,7 @@ expect.extend({
|
||||||
return { message: () => preserves`expected an exception not matching the filter`,
|
return { message: () => preserves`expected an exception not matching the filter`,
|
||||||
pass: true };
|
pass: true };
|
||||||
} else {
|
} else {
|
||||||
return { message: () => preserves`expected an exception matching the filter: ${e.constructor.name}`,
|
return { message: () => preserves`expected an exception matching the filter: ${(e as any)?.constructor?.name}`,
|
||||||
pass: false };
|
pass: false };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue