Repository navigation
chore: Bump Imposter from 0.2.23 to 1.0.2 - #902
Conversation
Test Results 24 files 24 suites 42m 42s ⏱️ Results for commit 5a85531. ♻️ This comment has been updated with latest results. |
--- updated-dependencies: - dependency-name: Imposter dependency-version: 1.0.2 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
5311dd4 to
5a85531
Compare
🚀 Benchmark ResultsDetails
Details
Details
Details
Details
Details
|
….2 (#902) by dependabot[bot]
….2 (#902) by dependabot[bot]
Updated Imposter from 0.2.23 to 1.0.2.
Release notes
Sourced from Imposter's releases.
1.0.2
Fixes
Async methods now wait for their callbacks (#409, closes #397). For a method returning
Task,Task<T>,ValueTaskorValueTask<T>, a callback returns aTask, and that task used to be dropped: an exception in anasynccallback was never observed, and the call completed before the callback had. Callbacks still start when the method is called, in the order they were added. The task the method returns now completes after the arranged result and every callback that hadn't finished, and fails with the first failure. Callbacks that complete synchronously leave the arranged task unchanged.Behaviour change: a test whose async callback fails now sees that failure when it awaits the call.
Maintenance
AsyncCallbacksis a new public type inImposter.Abstractions, for generated code only. It is hidden from IntelliSense.1.0.1
Fixes
Arg<int>.Is(5),_ => { }and$GITHUB_OUTPUTreached the package asArg\<int>,\_ =>and$GITHUB\_OUTPUT. A small script in the repository now drops only the markup the notes use, and the package smoke test checks the converted text on every pull request.No change to the generator or the runtime API.
1.0.0
Imposter 1.0.0 is the first stable release. The package is the same single
Imposterpackage as the 0.2.x line, with the generator and theImposter.Abstractionsruntime inside, and 0.2.27 upgrades to it without code changes.What 1.0.0 commits to
Imposter.Abstractions: theGenerateImposterattribute,Argand the span and out matchers,Count,ImposterMode,IHaveImposterInstance<T>withInstance(), and the two exceptions. See the Key API Reference.TypeCaster,SpanElementsComparer<T>andSetupCollection<T>are public because generated imposters call them, but they are hidden from IntelliSense and may change with the generator in the same package.Changes since 0.2.27
TypeCasterandSpanElementsComparer<T>carryEditorBrowsable(Never)likeSetupCollection<T>; the Key API Reference gains an "Imposter Instance" section forIHaveImposterInstance<T>andInstance()._lastestInvocationImposterfield is now spelled_latestInvocationImposter(#394, closes #390). The field is private to the generated class, so nothing changes for callers.0.2.27
Maintenance
$GITHUB_OUTPUTwith a fixedEOFdelimiter is gone, so a release body that contains a line of exactlyEOFcan no longer truncate the notes or fail the job. With #387, this is the first release whose notes reach the package through the file-based path, and it exercises that path end to end. No change to the generator or the runtime API.0.2.26
Fixes
Setups that aren't configured yet no longer hide configured ones (#383, closes #381). A method setup took part in matching as soon as its arguments were given, before
Returns,ThrowsorCallbackconfigured it. Until then, a matching call returned the default value or threwMissingImposterException, even when an older setup had an outcome. That could happen in three ways:imposter.Get(Arg<int>.Is(5)).Called(Count.Once()), which made laterGet(5)calls lose an earlierReturns;A call now uses the newest matching setup that has an outcome. A setup without one is used only when nothing configured matches, so a bare void setup still allows its call in explicit mode. Behaviour change: a newer bare setup no longer overrides an older
ThrowsorCallbackfor the same arguments. To make such a case do nothing, give its setup an empty callback:.Callback(_ => { }).Maintenance
using(#385, closes #384). No behaviour change.0.2.25
Performance
Calls no longer allocate to find their setup (#376, closes #371). Looking up the matching setup used to enumerate a concurrent stack, which allocated on every call. Setups now live in a
SetupCollection<T>that's enumerated without allocating, and the newest matching setup still wins. Bytes per call:SetupCollection<T>is a new public type inImposter.Abstractions, for generated code only. It's hidden from IntelliSense.Less generator work on every edit (#377, closes #370). The generator now chooses each type parameter's generated name once per symbol. It writes types with no renamed type parameter directly. This drops the allocations of the incremental run after an edit by 20% for plain targets and by half for generic ones, and the generated code is unchanged.
Maintenance
benchmarks/Imposter.GeneratorBenchmarks) measures cold and incremental runs (#377, #382, closes #374).0.2.24
Fixes
Type parameters named
await,file,required,scopedorextension(#378, closes #369). A target or method type parameter with one of these names made the imposter fail to compile:fileandrequiredfrom C# 11, read as modifiers;extensionfrom C# 14, read as an extension block;scopedfrom C# 11;awaitin async methods.A type parameter named like any contextual keyword your compiler knows now takes another name in generated code, as
var,_,recordandpartialalready did. That covers keywords later compilers add, such as the C# 15 preview'sclosedandunion. You still write the imposter and its setups with your own type arguments, and dedicated namespaces keep the original names.Method type parameters named like members of their generated types (#373, closes #349). A generic method whose type parameter was named
Invoke,Returns,Matches,As,Callback,Then,Resultor another member of the types generated for it failed with CS0102. Such a type parameter now takes another name in generated code; your setups don't change.Maintenance
Commits viewable in compare view.