Skip to content

Commit

Permalink
Documentation update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrunwald committed Mar 16, 2012
1 parent 47d7d5a commit ce2e528
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 19 deletions.
3 changes: 3 additions & 0 deletions ICSharpCode.NRefactory.CSharp.AstVerifier/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

bin/
obj/
16 changes: 14 additions & 2 deletions ICSharpCode.NRefactory.ConsistencyCheck/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,19 @@ These checks assume that the code is valid C# without any compilation errors,
so make sure to only pass in compilable source code.

Checks currently being performed:
- Checks that ID strings are unique and refer back to the correct entity
- Roundtripping test: parses C# code and outputs it again using CSharpOutputVisitor, checking that only whitespace is changing
- IDStringConsistencyCheck: Checks that ID strings are unique and refer back to the correct entity
- RoundtripTest: parses C# code and outputs it again using CSharpOutputVisitor, checking that only whitespace is changing
- ResolverTest: fully resolves all ASTs and validates that no errors are detected (no false positives in semantic error checking)
- RandomizedOrderResolverTest: checks that the order of Resolve()/GetResolverState() calls has no effect on the result
- FindReferencesConsistencyCheck: checks that FindReferences is the inverse of FindReferencedEntities

XML Tests:
- IncrementalXmlParserTests: tests that incremental parsing produces results identical to a full reparse
- XmlReaderTests: compares AXmlParser.Parse().CreateReader() with new XmlTextReader()



Ideas for further tests:
- Test token positions (see AstVerifier)
- Compare resolve results with csc compiler output (using Cecil)
- Randomly mutate a C# file (e.g. remove tokens) and verify that the parser does not crash
2 changes: 1 addition & 1 deletion ICSharpCode.NRefactory.Xml/AXmlParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace ICSharpCode.NRefactory.Xml
{
/// <summary>
/// XML tag soup parser that .
/// XML parser that is error tolerant.
/// </summary>
public class AXmlParser
{
Expand Down
16 changes: 0 additions & 16 deletions doc/TODO
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,3 @@ Features:
For integration into SharpDevelop:
- Review NR and DOM changes done in the timeframe



Idea for automated testing of the NR resolver:

Given some source code + the references,
Compile source code with MS C# Compiler
Load references into NR.TypeSystem
Load source code into NR.TypeSystem
Load compiled assembly into NR.TypeSystem
Compare entities 3a. and 3b. (but ignore compiled-generated members - ILSpy has logic to detect those)
For each method:
Resolve whole method with ResolveVisitor
Ensure there are no errors detected
Extract list of methods being called (incl. op_Implicit etc.)
Compare with methods being called in compiled assembly. (also compare type arguments)

0 comments on commit ce2e528

Please sign in to comment.