Explorar el Código

Fixing unit test

Sebastien Ros hace 7 años
padre
commit
630dcf83cf
Se han modificado 2 ficheros con 8 adiciones y 3 borrados
  1. 3 3
      Jint.Tests/Runtime/EngineTests.cs
  2. 5 0
      Jint/Native/JsString.cs

+ 3 - 3
Jint.Tests/Runtime/EngineTests.cs

@@ -1972,7 +1972,7 @@ namespace Jint.Tests.Runtime
 
 
             Assert.True(result);
             Assert.True(result);
         }
         }
-        
+
         [Fact]
         [Fact]
         public void ShouldNotCompareClrInstancesWithObjects()
         public void ShouldNotCompareClrInstancesWithObjects()
         {
         {
@@ -2468,8 +2468,8 @@ namespace Jint.Tests.Runtime
             var actualValue = engine.Execute(actual).GetCompletionValue().ToObject();
             var actualValue = engine.Execute(actual).GetCompletionValue().ToObject();
             Assert.Equal(expectedValue, actualValue);
             Assert.Equal(expectedValue, actualValue);
         }
         }
-	
-	[Fact]
+
+        [Fact]
         public void ShouldReturnCorrectConcatenatedStrings()
         public void ShouldReturnCorrectConcatenatedStrings()
         {
         {
             RunTest(@"
             RunTest(@"

+ 5 - 0
Jint/Native/JsString.cs

@@ -171,6 +171,11 @@ namespace Jint.Native
                     || _stringBuilder != null && _stringBuilder.Length == 0;
                     || _stringBuilder != null && _stringBuilder.Length == 0;
             }
             }
 
 
+            public override object ToObject()
+            {
+                return _stringBuilder.ToString();
+            }
+
             public override bool Equals(JsValue other)
             public override bool Equals(JsValue other)
             {
             {
                 if (other is ConcatenatedString cs)
                 if (other is ConcatenatedString cs)