Skip to content

Commit

Permalink
Add csc.rsp & test project for unity
Browse files Browse the repository at this point in the history
  • Loading branch information
hadashiA committed Dec 8, 2023
1 parent 8f1101d commit 27eb8fb
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 4 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions src/Utf8StringInterpolation.Unity/Assets/Tests.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "Utf8StringInterpolation.Tests",
"rootNamespace": "",
"references": [
"UnityEngine.TestRunner",
"UnityEditor.TestRunner",
"Utf8StringInterpolation"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": true,
"precompiledReferences": [
"nunit.framework.dll"
],
"autoReferenced": false,
"defineConstraints": [
"UNITY_INCLUDE_TESTS"
],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions src/Utf8StringInterpolation.Unity/Assets/Tests/Utf8StringTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System.Collections;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using UnityEngine;


namespace Utf8StringInterpolation.Tests;

public class Utf8StringTest
{
[Test]
public void Sample()
{
var name = "foo";
var id = 123;
var result = Utf8String.Format($"Hello, {name}, Your id is {id}!");
var expected = Encoding.UTF8.GetBytes($"Hello, {name}, Your id is {id}!");
Assert.That(result, Is.EquivalentTo(expected));
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions src/Utf8StringInterpolation.Unity/Assets/csc.rsp.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -641,8 +641,7 @@ PlayerSettings:
webGLPowerPreference: 2
scriptingDefineSymbols: {}
additionalCompilerArguments:
Standalone:
- -langVersion:latest
Standalone: []
platformArchitecture: {}
scriptingBackend: {}
il2cppCompilerConfiguration: {}
Expand Down
2 changes: 1 addition & 1 deletion src/Utf8StringInterpolation/Utf8String.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Utf8StringInterpolation;
public static class Utf8String
{
// Format API

public static byte[] Format(ref Utf8StringWriter<ArrayBufferWriter<byte>> format)
{
format.Flush();
Expand Down

0 comments on commit 27eb8fb

Please sign in to comment.