diff --git a/.gitignore b/.gitignore index efb483a..784dccc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,6 @@ /bin/Debug /obj/Debug *.suo +/.svn +/src/obj +/src/bin diff --git a/src/Acceptance/ParserAcceptanceTests.cs b/src/Acceptance/ParserAcceptanceTests.cs index dda6621..5eb6a8a 100644 --- a/src/Acceptance/ParserAcceptanceTests.cs +++ b/src/Acceptance/ParserAcceptanceTests.cs @@ -31,6 +31,8 @@ namespace Pytocs.Acceptance [TestFixture] public class ParserAcceptanceTests { + private static readonly string nl = Environment.NewLine; + private string XlatModule(string pyModule) { var rdr = new StringReader(pyModule); @@ -105,7 +107,8 @@ def on_menuitem_realize(self, menuitem, refactoring): menuitem.set_state(gtk.STATE_INSENSITIVE) def on_menuitem_activate(self, menuitem, refactoring): - # Ask user input +" + +" # Ask user input" + @" args = refactoring.input( self.model.get_term(), self.model.get_selection(), @@ -157,10 +160,11 @@ def PopupMenu(model): menu = gtk.Menu() - #menuitem = gtk.MenuItem() - #menuitem.show() - #menu.prepend(menuitem) - +" + +" #menuitem = gtk.MenuItem()" + nl + +" #menuitem.show()" + nl + +" #menu.prepend(menuitem)" + nl + +@" menuitem = gtk.MenuItem(""View"") viewmenu = ViewMenu(model) menuitem.set_submenu(viewmenu) diff --git a/src/Translate/StatementTranslator.Tests.cs b/src/Translate/StatementTranslator.Tests.cs index 6f37836..b8341ae 100644 --- a/src/Translate/StatementTranslator.Tests.cs +++ b/src/Translate/StatementTranslator.Tests.cs @@ -714,10 +714,9 @@ public void Stmt_EmptyCommentLine() public void Stmt_IfWithCommentEmptyCommentLine() { var pyStm = -@"if args: - # Comment - args = 0 -"; +@"if args:"+ nl + +" # Comment"+ nl + +" args = 0" + nl; var sExp = @"if (args) { // Comment @@ -733,9 +732,8 @@ public void Stmt_CommentedArg() var pyStm = @"foo( bar, - #baz - ) -"; +" +" #baz" + nl + +" )" + nl; var sExp = "foo(bar);\r\n"; Assert.AreEqual(sExp, XlatStmts(pyStm)); } @@ -744,12 +742,11 @@ public void Stmt_CommentedArg() public void Stmt_TrailingComment() { var pyStm = -@"try: - bonehead() -#if toast whine. -except: - whine() -"; +"try:" + nl + +" bonehead()" + nl + +"#if toast whine." + nl + +"except:" + nl + +" whine()" + nl; var sExp = @"try { bonehead();