-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed some bugs where variance wasn't properly printed on generics in…
… the other partial definitions.
- Loading branch information
1 parent
e1df143
commit 4dee591
Showing
3 changed files
with
82 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using NUnit.Framework; | ||
|
||
|
||
namespace schema.binary.text { | ||
internal class VarianceGeneratorTests { | ||
[Test] | ||
[TestCase("in")] | ||
[TestCase("out")] | ||
public void TestSupportsEachTypeOfVarianceInType(string variance) { | ||
BinarySchemaTestUtil.AssertGenerated( | ||
$$""" | ||
using schema.binary; | ||
namespace foo.bar { | ||
[BinarySchema] | ||
public partial class Wrapper<{{variance}} T>; | ||
} | ||
""", | ||
$$""" | ||
using System; | ||
using schema.binary; | ||
namespace foo.bar { | ||
public partial class Wrapper<{{variance}} T> { | ||
public void Read(IBinaryReader br) { | ||
} | ||
} | ||
} | ||
""", | ||
$$""" | ||
using System; | ||
using schema.binary; | ||
namespace foo.bar { | ||
public partial class Wrapper<{{variance}} T> { | ||
public void Write(IBinaryWriter bw) { | ||
} | ||
} | ||
} | ||
"""); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters