-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added a basic output.txt for end-to-end Enums test (#513)
- Loading branch information
Josh Goldberg
authored
Nov 2, 2018
1 parent
576fa9b
commit 1d1b3a9
Showing
15 changed files
with
140 additions
and
68 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,28 @@ | ||
// | ||
using System; | ||
|
||
namespace Enums | ||
{ | ||
enum Direction | ||
{ | ||
Unknown = 0, | ||
Horizontal = 1, | ||
Vertical = 2 | ||
} | ||
|
||
class Index | ||
{ | ||
public static void Main() | ||
{ | ||
Console.WriteLine(string.Format("Unknown by lookup is {0}", Direction.Unknown)); | ||
Console.WriteLine(string.Format("Horizontal by lookup is {0}", Direction.Horizontal)); | ||
Console.WriteLine(string.Format("Vertical by lookup is {0}", Direction.Vertical)); | ||
|
||
Direction direction; | ||
Direction unknown = Direction.Unknown; | ||
|
||
Console.WriteLine(string.Format("unknown variable is {0}", unknown)); | ||
} | ||
} | ||
} | ||
// |
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,6 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>netcoreapp2.0</TargetFramework> | ||
</PropertyGroup> | ||
</Project> |
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,22 @@ | ||
- | ||
file start : Enums Index | ||
enum start : Direction | ||
enum member : Unknown 0 , | ||
enum member : Horizontal 1 , | ||
enum member : Vertical 2 | ||
enum end | ||
|
||
main context start | ||
main start | ||
print : { string format : ("Unknown by lookup is {0}") { enum : Direction Unknown } int } | ||
print : { string format : ("Horizontal by lookup is {0}") { enum : Direction Horizontal } int } | ||
print : { string format : ("Vertical by lookup is {0}") { enum : Direction Vertical } int } | ||
|
||
variable : direction Direction | ||
variable : unknown Direction { enum : Direction Unknown } | ||
|
||
print : { string format : ("unknown variable is {0}") unknown int } | ||
main end | ||
main context end | ||
file end | ||
- |
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,22 @@ | ||
// | ||
package enums; | ||
|
||
enum Direction { | ||
Unknown(0), | ||
Horizontal(1), | ||
Vertical(2) | ||
} | ||
|
||
class Index { | ||
public static void main(String[] args) { | ||
System.out.println(String.format("Unknown by lookup is %0$d", Direction.Unknown)); | ||
System.out.println(String.format("Horizontal by lookup is %0$d", Direction.Horizontal)); | ||
System.out.println(String.format("Vertical by lookup is %0$d", Direction.Vertical)); | ||
|
||
Direction direction; | ||
Direction unknown = Direction.Unknown; | ||
|
||
System.out.println(String.format("unknown variable is %0$d", unknown)); | ||
} | ||
} | ||
// |
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,16 @@ | ||
// | ||
const Direction = { | ||
Unknown: 0, | ||
Horizontal: 1, | ||
Vertical: 2 | ||
}; | ||
|
||
console.log(`Unknown by lookup is ${Direction.Unknown}`); | ||
console.log(`Horizontal by lookup is ${Direction.Horizontal}`); | ||
console.log(`Vertical by lookup is ${Direction.Vertical}`); | ||
|
||
let direction; | ||
let unknown = Direction.Unknown; | ||
|
||
console.log(`unknown variable is ${unknown}`); | ||
// |
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,15 @@ | ||
# | ||
class Direction(Enum): | ||
Unknown = 0 | ||
Horizontal = 1 | ||
Vertical = 2 | ||
|
||
if __name__ == "__main__": | ||
print("Unknown by lookup is {0}".format(Direction.Unknown)) | ||
print("Horizontal by lookup is {0}".format(Direction.Horizontal)) | ||
print("Vertical by lookup is {0}".format(Direction.Vertical)) | ||
|
||
unknown = Direction.Unknown | ||
|
||
print("unknown variable is {0}".format(unknown)) | ||
# |
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,15 @@ | ||
# | ||
class Direction | ||
Unknown = 0 | ||
Horizontal = 1 | ||
Vertical = 2 | ||
end | ||
|
||
puts "Unknown by lookup is %d" % [Direction::Unknown] | ||
puts "Horizontal by lookup is %d" % [Direction::Horizontal] | ||
puts "Vertical by lookup is %d" % [Direction::Vertical] | ||
|
||
unknown = Direction::Unknown | ||
|
||
puts "unknown variable is %d" % [unknown] | ||
# |
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,16 @@ | ||
// | ||
enum Direction { | ||
Unknown = 0, | ||
Horizontal = 1, | ||
Vertical = 2 | ||
} | ||
|
||
console.log(`Unknown by lookup is ${Direction.Unknown}`); | ||
console.log(`Horizontal by lookup is ${Direction.Horizontal}`); | ||
console.log(`Vertical by lookup is ${Direction.Vertical}`); | ||
|
||
let direction: Direction; | ||
let unknown: Direction = Direction.Unknown; | ||
|
||
console.log(`unknown variable is ${unknown}`); | ||
// |