Browse Source

Add failing unit test for CompilationUnit.ConditionalSymbols.

newNRvisualizers
Daniel Grunwald 14 years ago
parent
commit
6bd0bfc5a8
  1. 5
      ICSharpCode.NRefactory.CSharp/Resolver/Log.cs
  2. 19
      ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/PreprocessorDirectiveTests.cs
  3. 3
      ICSharpCode.NRefactory/Utils/LazyInit.cs

5
ICSharpCode.NRefactory.CSharp/Resolver/Log.cs

@ -19,12 +19,7 @@ @@ -19,12 +19,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading;
using ICSharpCode.NRefactory.TypeSystem;
using ICSharpCode.NRefactory.TypeSystem.Implementation;
namespace ICSharpCode.NRefactory.CSharp.Resolver
{

19
ICSharpCode.NRefactory.Tests/CSharp/Parser/GeneralScope/PreprocessorDirectiveTests.cs

@ -245,5 +245,24 @@ class B { } @@ -245,5 +245,24 @@ class B { }
Assert.AreEqual(PreProcessorDirectiveType.Elif, bbb.Type);
Assert.AreEqual("BBB", bbb.Argument);
}
[Test]
[Ignore("parser bug (BBB is missing)")]
public void ConditionalSymbolTest()
{
const string program = @"// Test
#if AAA
#undef AAA
#define CCC
#else
#define DDD
#endif
class C {}";
CSharpParser parser = new CSharpParser();
parser.CompilerSettings.ConditionalSymbols.Add("AAA");
parser.CompilerSettings.ConditionalSymbols.Add("BBB");
var cu = parser.Parse(program, "elif.cs");
Assert.AreEqual(new[] { "BBB", "CCC" }, cu.ConditionalSymbols);
}
}
}

3
ICSharpCode.NRefactory/Utils/LazyInit.cs

@ -17,10 +17,7 @@ @@ -17,10 +17,7 @@
// DEALINGS IN THE SOFTWARE.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading;
using ICSharpCode.NRefactory.TypeSystem;
namespace ICSharpCode.NRefactory.Utils
{

Loading…
Cancel
Save