mirror of
https://github.com/FabInfra/capnproto-dotnetcore_Runtime.git
synced 2025-04-21 02:26:31 +02:00
Test annotations and constants in schemas processed for generation.
This commit is contained in:
parent
881a59b2c9
commit
84385bbecd
10
capnpc-csharp.tests/Properties/Resources.Designer.cs
generated
10
capnpc-csharp.tests/Properties/Resources.Designer.cs
generated
@ -90,6 +90,16 @@ namespace capnpc_csharp.Tests.Properties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Looks up a localized resource of type System.Byte[].
|
||||||
|
/// </summary>
|
||||||
|
internal static byte[] UnitTest20_capnp {
|
||||||
|
get {
|
||||||
|
object obj = ResourceManager.GetObject("UnitTest20_capnp", resourceCulture);
|
||||||
|
return ((byte[])(obj));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Looks up a localized resource of type System.Byte[].
|
/// Looks up a localized resource of type System.Byte[].
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -121,6 +121,9 @@
|
|||||||
<data name="UnitTest10_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="UnitTest10_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\UnitTest10.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>..\Resources\UnitTest10.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="UnitTest20_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
|
<value>..\Resources\UnitTest20.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
|
</data>
|
||||||
<data name="UnitTest3_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
<data name="UnitTest3_capnp" type="System.Resources.ResXFileRef, System.Windows.Forms">
|
||||||
<value>..\Resources\UnitTest3.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
<value>..\Resources\UnitTest3.capnp.bin;System.Byte[], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||||
</data>
|
</data>
|
||||||
|
BIN
capnpc-csharp.tests/Resources/UnitTest20.capnp.bin
Normal file
BIN
capnpc-csharp.tests/Resources/UnitTest20.capnp.bin
Normal file
Binary file not shown.
5
capnpc-csharp.tests/UnitTest20.capnp
Normal file
5
capnpc-csharp.tests/UnitTest20.capnp
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
@0xcebb7a61a86a7492;
|
||||||
|
|
||||||
|
annotation anAnnotation(file): Text;
|
||||||
|
|
||||||
|
const aConstant :UInt16 = 42;
|
@ -71,6 +71,15 @@ namespace CapnpC
|
|||||||
Assert.AreEqual($"{innerNSStr}.Inner", innerNameSyntax.ToString());
|
Assert.AreEqual($"{innerNSStr}.Inner", innerNameSyntax.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void Test20AnnotationAndConst()
|
||||||
|
{
|
||||||
|
var model = Load(Resources.UnitTest20_capnp);
|
||||||
|
var codeGen = NewGeneratorFor(model);
|
||||||
|
codeGen.Transform(model.FilesToGenerate.First());
|
||||||
|
// Should not throw
|
||||||
|
}
|
||||||
|
|
||||||
static Generator.CodeGenerator NewGeneratorFor(Model.SchemaModel model)
|
static Generator.CodeGenerator NewGeneratorFor(Model.SchemaModel model)
|
||||||
=> new Generator.CodeGenerator(model, new Generator.GeneratorOptions());
|
=> new Generator.CodeGenerator(model, new Generator.GeneratorOptions());
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user