public void ADashCanBeEscaped() { var handle = new TokenizerHandle(DataMother.GetFile("_scriptNeedingDashEscaping.txt")); handle.FastForwardToLine(5); var t = handle.ProcessWithToken<AnyToken>(); t["ZipFileName"].ShouldBeEqualTo("ber-$(currentTag).zip"); }
public void BacktickTokenWorks() { var handle = new TokenizerHandle(DataMother.GetFile("backtick check.txt")); handle.FastForwardToLine(3); var t = handle.ProcessWithToken<BacktickToken>(); t.BackTickValue.ShouldBeEqualTo("echo y| cacls %(Binaries.Identity) /G everyone:R"); }
public void PowershellScriptCallToken() { var handle = new TokenizerHandle(DataMother.GetFile("_scriptWithPowershellExecAsTask.txt")); handle.FastForwardToLine(4); var t = handle.ProcessWithToken<PSScriptCallToken>(); t.ShouldNotBeNull(); t.Word.ShouldBeEqualTo("MakeFile"); }
public void NodeWithOptionsHasIndexer() { var handle = new TokenizerHandle(DataMother.GetEmptyProjectFile()); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t["DefaultTargets"].ShouldBeEqualTo("Main"); t["Bla"].ShouldBeNull(); }
public void NodeWithOptionsEscapesDefault() { var handle = new TokenizerHandle(DataMother.GetFile("node with default needs escaping.txt")); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t["Default"].ShouldBeEqualTo("Default stuff \" Hoho"); t.Options.Count.ShouldBeEqualTo(4); }
public void DefaultOptionMapping() { var handle = new TokenizerHandle(DataMother.NodeWithOptionsVariantB()); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t.MapDefaultTo("Option1"); t["Default"].ShouldBeNull(); t["Option1"].ShouldNotBeNull(); }
public void NodeWithOptionsWorksAsExpected() { var handle = new TokenizerHandle(DataMother.GetNodeWithOptions()); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t.ShouldNotBeNull(); t.Options.ShouldHaveCount(4); t.Options["Default"].StartsWith("Default").ShouldBeTrue(); t.Options["Option1"].ShouldBeEqualTo("Bla di Bla"); t.Options["Option3"].ShouldBeEqualTo("Blablub"); }
public void PowershellScriptToken() { var handle = new TokenizerHandle(DataMother.GetFile("_scriptWithPowershell.txt")); handle.FastForwardToLine(7); var t = handle.ProcessWithToken<PSExternalScriptToken>(); t.ScriptName.ShouldBeEqualTo("smallPNGs"); t.Script.IndexOf("echo").ShouldBeSmallerThan(5); t.Script.Contains("FullName").ShouldBeTrue(); t.Terminator.ShouldBeEqualTo("END"); }
public void PowershellScriptCallTokenNotMatchingScriptDef() { var handle = new TokenizerHandle(DataMother.GetFile("_scriptWithPowershell.txt")); handle.FastForwardToLine(7); var t = handle.ProcessWithToken<PSScriptCallToken>(); t.ShouldBeNull(); }
public void VariableTokenWorksAsExpected() { var handle = new TokenizerHandle(DataMother.ProjectAndTarget()); handle.FastForwardToLine(2); var t = handle.ProcessWithToken<VariableToken>(); t.ShouldNotBeNull(); t.VariableName.ShouldBeEqualTo("Foo"); t.Value.ShouldBeEqualTo("Bar Baz"); }
public void TargetTokenWorksAsExpected() { var handle = new TokenizerHandle(DataMother.ProjectAndTarget()); handle.FastForwardToLine(3); var t = handle.ProcessWithToken<TargetToken>(); t.ShouldNotBeNull(); t.Options.ShouldHaveCount(2); t.Options["Default"].StartsWith("Default").ShouldBeTrue(); t.Options["Depends"].StartsWith("Deps").ShouldBeTrue(); }
public void ProjectTokenWorksAsExpectedVariantB() { var handle = new TokenizerHandle(DataMother.NodeWithOptionsVariantB()); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t.ShouldNotBeNull(); t.Options.Count.ShouldBeEqualTo(3); }
public void ProjectTokenWorksAsExpected() { var handle = new TokenizerHandle("Project \"Main\""); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t.ShouldNotBeNull(); t.Options.Count.ShouldBeEqualTo(1); t.Word.ShouldBeEqualTo("Project"); }
public void ProjectTokenDoesNotGobbleOptionsOfTargetToken() { var handle = new TokenizerHandle(DataMother.ProjectAndTarget()); handle.FastForwardToLine(1); var t = handle.ProcessWithToken<ProjectToken>(); t.Options.ShouldHaveCount(1); }