-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
109 additions
and
5 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
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
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
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
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 @@ | ||
import sys, os | ||
myPath = os.path.dirname(os.path.abspath(__file__)) | ||
sys.path.insert(0, myPath + '/../') | ||
|
||
import logging | ||
import Colorer | ||
logging.basicConfig(level=logging.DEBUG,format='%(name)s - %(levelname)s - %(message)s', datefmt='%m/%d/%Y %I:%M:%S %p') | ||
|
||
import ast | ||
import z3 | ||
from pyPath import Path | ||
from pyPathGroup import PathGroup | ||
import pytest | ||
from pyObjectManager.Int import Int | ||
from pyObjectManager.Real import Real | ||
from pyObjectManager.BitVec import BitVec | ||
from pyObjectManager.List import List | ||
from pyState.z3Helpers import Z3_MAX_STRING_LENGTH | ||
|
||
test1 = """ | ||
s = pyState.Real() | ||
s2 = pyState.Real(123) | ||
s3 = pyState.Real(123.5) | ||
""" | ||
|
||
|
||
def test_function_pyState_Real(): | ||
b = ast.parse(test1).body | ||
p = Path(b,source=test1) | ||
pg = PathGroup(p) | ||
|
||
pg.explore() | ||
assert len(pg.completed) == 1 | ||
|
||
s = pg.completed[0].state.getVar('s') | ||
s2 = pg.completed[0].state.getVar('s2') | ||
s3 = pg.completed[0].state.getVar('s3') | ||
|
||
assert type(s) == Real | ||
assert type(s2) == Real | ||
assert type(s3) == Real | ||
|
||
assert s.canBe(123.0) | ||
assert s2.getValue() == 123.0 | ||
assert s3.getValue() == 123.5 |