-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Whoops, fixed bug with variables test. Now can release 0.2.1.
- Loading branch information
1 parent
2e5c1cc
commit f9c1cae
Showing
5 changed files
with
30 additions
and
11 deletions.
There are no files selected for viewing
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 @@ | ||
id,text,file,node,lineNumber |
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 @@ | ||
title: Start | ||
--- | ||
<<set $value_string to "string">> | ||
<<set $value_float to 1.25>> | ||
<<set $value_bool to true>> | ||
=== |
Binary file not shown.
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 |
---|---|---|
@@ -1,20 +1,31 @@ | ||
import os | ||
from .context import YarnRunner | ||
|
||
compiled_yarn_f = open(os.path.join(os.path.dirname( | ||
compiled_yarn_f1 = open(os.path.join(os.path.dirname( | ||
__file__), '../examples/yarn1/variables.yarnc'), 'rb') | ||
names_csv_f = open(os.path.join(os.path.dirname( | ||
names_csv_f1 = open(os.path.join(os.path.dirname( | ||
__file__), '../examples/yarn1/variables.csv'), 'r') | ||
compiled_yarn_f2 = open(os.path.join(os.path.dirname( | ||
__file__), '../examples/yarn2/variables.yarnc'), 'rb') | ||
names_csv_f2 = open(os.path.join(os.path.dirname( | ||
__file__), '../examples/yarn2/variables.csv'), 'r') | ||
|
||
runner = YarnRunner(compiled_yarn_f, names_csv_f) | ||
runner1 = YarnRunner(compiled_yarn_f1, names_csv_f1) | ||
runner2 = YarnRunner(compiled_yarn_f2, names_csv_f2) | ||
|
||
|
||
def test_variables(): | ||
assert not runner.has_line() | ||
assert runner.finished | ||
assert runner.variables["$value_string"] == "string" | ||
assert runner.variables["$value_float"] == 1.25 | ||
assert runner.variables["$value_bool"] == True | ||
assert runner.variables["$value_null"] is None | ||
def test_variables1(): | ||
assert not runner1.has_line() | ||
assert runner1.finished | ||
assert runner1.variables["$value_string"] == "string" | ||
assert runner1.variables["$value_float"] == 1.25 | ||
assert runner1.variables["$value_bool"] == True | ||
assert runner1.variables["$value_null"] is None | ||
|
||
# TODO, the variables.yarnc wouldn't compile under YSC 2.0.1-a2eff4c | ||
|
||
def test_variables2(): | ||
assert not runner2.has_line() | ||
assert runner2.finished | ||
assert runner2.variables["$value_string"] == "string" | ||
assert runner2.variables["$value_float"] == 1.25 | ||
assert runner2.variables["$value_bool"] == True |
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 @@ | ||
id,node,lineNumber,tags |