-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* #49 - рефакторинг на строго типизированные теории * #49 - исправление бага с помощью lookahead и lookbehind
- Loading branch information
Showing
3 changed files
with
35 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,36 @@ | ||
using System.Collections; | ||
using Xunit; | ||
|
||
namespace HydraScript.Tests.TestData; | ||
|
||
public class LexerSuccessData : IEnumerable<object[]> | ||
public class LexerSuccessData : TheoryData<string> | ||
{ | ||
public IEnumerator<object[]> GetEnumerator() | ||
public LexerSuccessData() | ||
{ | ||
yield return new object[] { "a + b - c return while do" }; | ||
yield return new object[] { "=> abc null true false" }; | ||
yield return new object[] { "{ . } , ( ) [] =?:" }; | ||
Add("a + b - c return while do"); | ||
Add("=> abc null true false"); | ||
Add("{ . } , ( ) [] =?:"); | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
} | ||
|
||
public class LexerFailData : IEnumerable<object[]> | ||
public class LexerFailData : TheoryData<string> | ||
{ | ||
public IEnumerator<object[]> GetEnumerator() | ||
public LexerFailData() | ||
{ | ||
yield return new object[] { "a + v $$$" }; | ||
yield return new object[] { "kkk &" }; | ||
yield return new object[] { "|| |" }; | ||
Add("a + v $$$"); | ||
Add("kkk &"); | ||
Add("|| |"); | ||
} | ||
} | ||
|
||
IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); | ||
public class LexerKeywordInsideIdentData : TheoryData<string> | ||
{ | ||
public LexerKeywordInsideIdentData() | ||
{ | ||
Add("constExpr"); | ||
Add("letVarConst"); | ||
Add("nullObj"); | ||
Add("trueStmt"); | ||
Add("falseStmt"); | ||
Add("returnResult"); | ||
} | ||
} |
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