Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LARA
inox
Commits
5c4571d3
Commit
5c4571d3
authored
8 years ago
by
Nicolas Voirol
Browse files
Options
Downloads
Patches
Plain Diff
Tip printing-parsing tests
parent
b56f0572
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/it/scala/inox/tip/TipPrintingSuite.scala
+48
-0
48 additions, 0 deletions
src/it/scala/inox/tip/TipPrintingSuite.scala
src/it/scala/inox/tip/TipTestSuite.scala
+3
-3
3 additions, 3 deletions
src/it/scala/inox/tip/TipTestSuite.scala
with
51 additions
and
3 deletions
src/it/scala/inox/tip/TipPrintingSuite.scala
0 → 100644
+
48
−
0
View file @
5c4571d3
/* Copyright 2009-2016 EPFL, Lausanne */
package
inox
package
tip
import
org.scalatest._
class
TipPrintingSuite
extends
FunSuite
with
ResourceUtils
{
import
inox.trees._
val
ctx
=
TestContext
.
empty
val
files
=
resourceFiles
(
"regression/tip/SAT"
,
_
.
endsWith
(
".tip"
)).
toList
++
resourceFiles
(
"regression/tip/UNSAT"
,
_
.
endsWith
(
".tip"
))
private
def
checkScript
(
syms
:
Symbols
,
expr
:
Expr
)
:
Unit
=
{
for
(
fd
<-
syms
.
functions
.
values
)
{
assert
(
fd
.
fullBody
.
getType
(
syms
)
!=
Untyped
)
}
assert
(
expr
.
getType
(
syms
)
!=
Untyped
)
}
for
(
file
<-
files
)
{
test
(
s
"Parsing file ${file.getName}"
)
{
for
((
syms
,
expr
)
<-
new
Parser
(
file
).
parseScript
)
{
checkScript
(
syms
,
expr
)
}
}
test
(
s
"Re-printing file ${file.getName}"
)
{
for
((
syms
,
expr
)
<-
new
Parser
(
file
).
parseScript
)
{
val
program
=
InoxProgram
(
ctx
,
syms
)
val
file
=
java
.
io
.
File
.
createTempFile
(
"test-output"
,
".tip"
)
val
fw
=
new
java
.
io
.
FileWriter
(
file
,
false
)
val
printer
=
new
Printer
(
program
,
fw
)
printer
.
printScript
(
expr
)
printer
.
emit
(
smtlib
.
parser
.
Commands
.
CheckSat
())
printer
.
free
()
val
Seq
((
newSyms
,
newExpr
))
=
new
Parser
(
file
).
parseScript
file
.
delete
()
checkScript
(
newSyms
,
newExpr
)
}
}
}
}
This diff is collapsed.
Click to expand it.
src/it/scala/inox/tip/T
IP
TestSuite.scala
→
src/it/scala/inox/tip/T
ip
TestSuite.scala
+
3
−
3
View file @
5c4571d3
...
...
@@ -6,13 +6,13 @@ package tip
import
solvers._
import
org.scalatest._
class
T
IP
TestSuite
extends
FunSuite
with
ResourceUtils
{
class
T
ip
TestSuite
extends
FunSuite
with
ResourceUtils
{
val
ctx
=
TestContext
.
empty
for
(
file
<-
resourceFiles
(
"regression/tip/SAT"
,
_
.
endsWith
(
".tip"
)))
{
test
(
s
"SAT - ${file.getName}"
)
{
for
((
syms
,
expr
)
<-
new
tip
.
Parser
(
file
).
parseScript
)
{
for
((
syms
,
expr
)
<-
new
Parser
(
file
).
parseScript
)
{
val
program
=
InoxProgram
(
ctx
,
syms
)
assert
(
SimpleSolverAPI
(
SolverFactory
.
default
(
program
)).
solveSAT
(
expr
).
isSAT
)
}
...
...
@@ -21,7 +21,7 @@ class TIPTestSuite extends FunSuite with ResourceUtils {
for
(
file
<-
resourceFiles
(
"regression/tip/UNSAT"
,
_
.
endsWith
(
".tip"
)))
{
test
(
s
"UNSAT - ${file.getName}"
)
{
for
((
syms
,
expr
)
<-
new
tip
.
Parser
(
file
).
parseScript
)
{
for
((
syms
,
expr
)
<-
new
Parser
(
file
).
parseScript
)
{
val
program
=
InoxProgram
(
ctx
,
syms
)
assert
(
SimpleSolverAPI
(
SolverFactory
.
default
(
program
)).
solveSAT
(
expr
).
isUNSAT
)
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment