Exemplo n.º 1
0
        public void MapCompilerError_before_origin()
        {
            var csSource = @"1
2
//#origin 1,origin.csrun
4->1
5->2
//#endorigin
7".Split('\n');

            try
            {
                var result = FailureMapper.MapCompiletimeErrors(new[]
                {
                    new CompilerError
                    {
                        Filename     = "destination.cs",
                        LineNumber   = 1,
                        ColumnNumber = 0,
                        Description  = "desc"
                    }
                }, csSource);

                Assert.Fail();
            }
            catch (Exception ex)
            {
                Assert.IsTrue(ex.Message.IndexOf("Cannot map") >= 0);
            }
        }
Exemplo n.º 2
0
        public void MapCompilerError()
        {
            var csSource = @"1
2
//#origin 1,origin.csrun
4->1
5->2
//#endorigin
7".Split('\n');

            var result = FailureMapper.MapCompiletimeErrors(new[] { new CompilerError {
                                                                        Filename     = "destination.cs",
                                                                        LineNumber   = 5,
                                                                        ColumnNumber = 10,
                                                                        Description  = "desc"
                                                                    } }, csSource);

            Assert.IsTrue(result.First().StartsWith($"origin.csrun-2,"));
        }
Exemplo n.º 3
0
        public void HandleCompilerErrors(IEnumerable <CompilerError> compilerErrors)
        {
            var errors = FailureMapper.MapCompiletimeErrors(compilerErrors, _csSource.Text);

            _log.DisplayCompilerErrors(errors);
        }