This instance will be upgraded to Heptapod 0.17.0 on 2020-11-26 at 14:00 UTC+1 (a few minutes of down time)

Commit 0a9c6408 authored by Jesse McGrew's avatar Jesse McGrew

Fix CRLF issues in tests.

parent 3461fe2b67ae
......@@ -1595,7 +1595,7 @@ namespace Zilf.Emit.Zap
text1 == null ? text2
: text2 == null ? text1
: text1 == text2 ? text1
: $"{text1}\r\n{INDENT}{text2}";
: $"{text1}{Environment.NewLine}{INDENT}{text2}";
}
public bool AreIdentical(ZapCode a, ZapCode b)
......
......@@ -27,21 +27,21 @@ namespace Zilf.Tests.Integration
public void TestAddToVariable()
{
AssertRoutine("\"AUX\" X Y", "<SET X <+ .X .Y>>")
.GeneratesCodeMatching(@"ADD X,Y >X\r\n\s*RETURN X");
.GeneratesCodeMatching(@"ADD X,Y >X\r?\n\s*RETURN X");
}
[TestMethod]
public void TestAddInVoidContextBecomesINC()
{
AssertRoutine("\"AUX\" X", "<SET X <+ .X 1>> .X")
.GeneratesCodeMatching(@"INC 'X\r\n\s*RETURN X");
.GeneratesCodeMatching(@"INC 'X\r?\n\s*RETURN X");
}
[TestMethod]
public void TestAddInValueContextBecomesINC()
{
AssertRoutine("\"AUX\" X", "<SET X <+ .X 1>>")
.GeneratesCodeMatching(@"INC 'X\r\n\s*RETURN X");
.GeneratesCodeMatching(@"INC 'X\r?\n\s*RETURN X");
}
[TestMethod]
......@@ -82,7 +82,7 @@ namespace Zilf.Tests.Integration
AssertRoutine("\"AUX\" X", "<COND (<OR <EQUAL? .X 1 2> <EQUAL? .X 3 4>> <RTRUE>)>")
.GeneratesCodeMatching(@"EQUAL\? X,1,2,3 /TRUE");
AssertRoutine("\"AUX\" X", "<COND (<OR <EQUAL? .X 1 2 3> <=? .X 4> <EQUAL? .X 5 6>> <RTRUE>)>")
.GeneratesCodeMatching(@"EQUAL\? X,1,2,3 /TRUE\r\n\s*EQUAL\? X,4,5,6 /TRUE");
.GeneratesCodeMatching(@"EQUAL\? X,1,2,3 /TRUE\r?\n\s*EQUAL\? X,4,5,6 /TRUE");
}
[TestMethod]
......@@ -104,7 +104,7 @@ namespace Zilf.Tests.Integration
AssertRoutine("\"AUX\" X", "<COND (<OR <EQUAL? .X 1 2> <=? .X 0> <EQUAL? .X 3 4>> <RTRUE>)>")
.GeneratesCodeMatching(@"EQUAL\? X,1,2,0 /TRUE");
AssertRoutine("\"AUX\" X", "<COND (<OR <EQUAL? .X 1 2> <EQUAL? .X 3 0>> <RTRUE>)>")
.GeneratesCodeMatching(@"EQUAL\? X,1,2,3 /TRUE\r\n\s*ZERO\? X /TRUE");
.GeneratesCodeMatching(@"EQUAL\? X,1,2,3 /TRUE\r?\n\s*ZERO\? X /TRUE");
}
[TestMethod]
......@@ -121,22 +121,22 @@ namespace Zilf.Tests.Integration
{
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X <FOO>>> <RTRUE>)>")
.WithGlobal("<ROUTINE FOO () <>>")
.GeneratesCodeMatching(@"CALL FOO >X\r\n\s*ZERO\? X /TRUE");
.GeneratesCodeMatching(@"CALL FOO >X\r?\n\s*ZERO\? X /TRUE");
}
[TestMethod]
public void TestValuePredicateContext_Constants()
{
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X <>>> <RTRUE>)>")
.GeneratesCodeMatching(@"SET 'X,0\r\n\s*RTRUE");
.GeneratesCodeMatching(@"SET 'X,0\r?\n\s*RTRUE");
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X 0>> <RTRUE>)>")
.GeneratesCodeMatching(@"SET 'X,0\r\n\s*RTRUE");
.GeneratesCodeMatching(@"SET 'X,0\r?\n\s*RTRUE");
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X 100>> <RTRUE>)>")
.GeneratesCodeMatching(@"SET 'X,100\r\n\s*RFALSE");
.GeneratesCodeMatching(@"SET 'X,100\r?\n\s*RFALSE");
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X T>> <RTRUE>)>")
.GeneratesCodeMatching(@"SET 'X,1\r\n\s*RFALSE");
.GeneratesCodeMatching(@"SET 'X,1\r?\n\s*RFALSE");
AssertRoutine("\"AUX\" X", "<COND (<NOT <SET X \"blah\">> <RTRUE>)>")
.GeneratesCodeMatching(@"SET 'X,STR\?\d+\r\n\s*RFALSE");
.GeneratesCodeMatching(@"SET 'X,STR\?\d+\r?\n\s*RFALSE");
}
[TestMethod]
......@@ -148,7 +148,7 @@ namespace Zilf.Tests.Integration
<SET CNT <+ .CNT 1>>
<COND (<NOT <SET X <NEXT? .X>>> <RETURN>)>>)>
.CNT").WhenCalledWith("<>")
.GeneratesCodeMatching(@"NEXT\? X >X /\?L\d+\r\n\s*\?L\d+:\s*RETURN CNT\r\n\r\n");
.GeneratesCodeMatching(@"NEXT\? X >X /\?L\d+\r?\n\s*\?L\d+:\s*RETURN CNT\r?\n\r?\n");
}
[TestMethod]
......
......@@ -1693,17 +1693,17 @@ namespace Zilf.Tests.Integration
AssertExpr("<PRINTT ,MYTEXT 6>")
.InV5()
.WithGlobal("<GLOBAL MYTEXT <TABLE (STRING) \"hansprestige\">>")
.Outputs("hanspr\r\n");
.Outputs($"hanspr{System.Environment.NewLine}");
AssertExpr("<PRINTT ,MYTEXT 4 3>")
.InV5()
.WithGlobal("<GLOBAL MYTEXT <TABLE (STRING) \"hansprestige\">>")
.Outputs("hans\r\npres\r\ntige\r\n");
.Outputs($"hans{System.Environment.NewLine}pres{System.Environment.NewLine}tige{System.Environment.NewLine}");
AssertExpr("<PRINTT ,MYTEXT 3 3 1>")
.InV5()
.WithGlobal("<GLOBAL MYTEXT <TABLE (STRING) \"hansprestige\">>")
.Outputs("han\r\npre\r\ntig\r\n");
.Outputs($"han{System.Environment.NewLine}pre{System.Environment.NewLine}tig{System.Environment.NewLine}");
}
[TestMethod]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment