-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix concretization of generic type instances in Elm compiler
+ Expand the example app to demo backend state serialization to cover more cases of instantiation of generic types: Add tuples, records, and instances of 'Maybe' with generic type arguments. + Automate test to assert that the demo app program code compiles. + Fix the concretization of generic type instances in compilation to generate JSON coding functions: Add coverage for 'instance', 'record', and 'tuple' cases.
- Loading branch information
Showing
6 changed files
with
128 additions
and
7 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
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
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
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,36 @@ | ||
using System.Collections.Immutable; | ||
using ElmFullstack; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using System.Linq; | ||
using Pine; | ||
|
||
namespace TestElmFullstack | ||
{ | ||
[TestClass] | ||
public class TestDemoBackendState | ||
{ | ||
[TestMethod] | ||
public void Test_demo_backend_state() | ||
{ | ||
var sourceFiles = | ||
TestSetup.GetElmAppFromDirectoryPath( | ||
ImmutableList.Create(".", "..", "..", "..", "..", "example-apps", "demo-backend-state")); | ||
|
||
var webAppSource = | ||
TestSetup.AppConfigComponentFromFiles(sourceFiles); | ||
|
||
var compilationResult = ElmAppCompilation.AsCompletelyLoweredElmApp( | ||
sourceFiles: sourceFiles, | ||
interfaceConfig: ElmAppInterfaceConfig.Default); | ||
|
||
var compilationSuccess = | ||
compilationResult.Extract(err => throw new System.Exception( | ||
"Failed compilation:\n" + | ||
string.Join("\n", err.Select(singleErr => ElmAppCompilation.DescribeCompilationError(singleErr))))); | ||
|
||
using var testSetup = WebHostAdminInterfaceTestSetup.Setup(deployAppConfigAndInitElmState: webAppSource); | ||
using var server = testSetup.StartWebHost(); | ||
using var publicAppClient = testSetup.BuildPublicAppHttpClient(); | ||
} | ||
} | ||
} |