-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mono-basic update: Command returns the raw command line without arg0.
For #116.
- Loading branch information
Esme Povirk
committed
Oct 30, 2021
1 parent
189f210
commit d5ddda4
Showing
3 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
Submodule mono-basic
updated
1 files
+27 −2 | vbruntime/Microsoft.VisualBasic/Microsoft.VisualBasic/Interaction.vb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Diagnostics; | ||
using System.Reflection; | ||
using Microsoft.VisualBasic; | ||
|
||
public class InteractionCommandTest | ||
{ | ||
public static void TestCommand (string cmd) | ||
{ | ||
var process = new Process(); | ||
process.StartInfo.FileName = Assembly.GetExecutingAssembly().Location; | ||
process.StartInfo.Arguments = cmd; | ||
process.StartInfo.UseShellExecute = false; | ||
process.StartInfo.EnvironmentVariables.Add ("EXPECTED_INTERACTION_COMMAND", "_" + cmd); | ||
process.Start (); | ||
process.WaitForExit (); | ||
if (process.ExitCode != 0) | ||
{ | ||
Environment.Exit (1); | ||
} | ||
} | ||
|
||
public static int Main (string[] args) | ||
{ | ||
if (Environment.GetEnvironmentVariable ("EXPECTED_INTERACTION_COMMAND") != null) | ||
{ | ||
if (Environment.GetEnvironmentVariable ("EXPECTED_INTERACTION_COMMAND").Substring (1) != Interaction.Command ()) | ||
{ | ||
Console.WriteLine ("Expected '{0}' got '{1}'", | ||
Environment.GetEnvironmentVariable ("EXPECTED_INTERACTION_COMMAND").Substring (1), | ||
Interaction.Command ()); | ||
return 1; | ||
} | ||
} | ||
else | ||
{ | ||
TestCommand (""); | ||
TestCommand ("\"\""); | ||
TestCommand ("\"test with quotes\""); | ||
TestCommand ("test without quotes"); | ||
} | ||
|
||
return 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters