Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
sarah.grebing
ProofScriptParser
Commits
e237f563
Commit
e237f563
authored
Aug 02, 2017
by
Sarah Grebing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Testcase for isclosable
parent
ddc82c18
Pipeline
#12490
failed with stage
in 1 minute and 40 seconds
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
13 deletions
+75
-13
src/test/java/edu/kit/formal/interpreter/KeYInterpreterTest.java
...t/java/edu/kit/formal/interpreter/KeYInterpreterTest.java
+51
-0
src/test/resources/edu/kit/formal/interpreter/contraposition/testIsClosable.kps
.../kit/formal/interpreter/contraposition/testIsClosable.kps
+11
-0
src/test/resources/edu/kit/formal/interpreter/javaExample/test.kps
...resources/edu/kit/formal/interpreter/javaExample/test.kps
+10
-5
src/test/resources/edu/kit/formal/interpreter/javaExample/testIsClosable.kps
...edu/kit/formal/interpreter/javaExample/testIsClosable.kps
+3
-8
No files found.
src/test/java/edu/kit/formal/interpreter/KeYInterpreterTest.java
0 → 100644
View file @
e237f563
package
edu.kit.formal.interpreter
;
import
de.uka.ilkd.key.proof.io.ProblemLoaderException
;
import
edu.kit.formal.interpreter.data.GoalNode
;
import
edu.kit.formal.interpreter.data.KeyData
;
import
edu.kit.formal.proofscriptparser.Facade
;
import
edu.kit.formal.proofscriptparser.ast.ProofScript
;
import
org.antlr.v4.runtime.CharStreams
;
import
org.junit.Assert
;
import
org.junit.Before
;
import
org.junit.Test
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.List
;
/**
* Created by sarah on 8/2/17.
*/
public
class
KeYInterpreterTest
{
KeYProofFacade
facade
;
@Before
public
void
init
()
{
facade
=
new
KeYProofFacade
();
}
public
Interpreter
<
KeyData
>
execute
(
InputStream
is
)
throws
IOException
{
List
<
ProofScript
>
scripts
=
Facade
.
getAST
(
CharStreams
.
fromStream
(
is
));
InterpreterBuilder
ib
=
facade
.
buildInterpreter
();
Interpreter
<
KeyData
>
i
=
ib
.
build
();
i
.
interpret
(
scripts
.
get
(
0
));
return
i
;
}
@Test
public
void
testIsClosable
()
throws
IOException
,
ProblemLoaderException
{
facade
.
loadKeyFile
(
new
File
(
"src/test/resources/edu/kit/formal/interpreter/contraposition/contraposition.key"
));
Interpreter
<
KeyData
>
i
=
execute
(
getClass
().
getResourceAsStream
(
"contraposition/testIsClosable.kps"
));
List
<
GoalNode
<
KeyData
>>
goals
=
i
.
getCurrentState
().
getGoals
();
Assert
.
assertEquals
(
2
,
goals
.
size
());
for
(
GoalNode
<
KeyData
>
goal
:
goals
)
{
Assert
.
assertEquals
(
"Label for node "
+
goal
.
getData
().
getNode
(),
"impLeft // impRight // $$"
,
goal
.
getData
().
getRuleLabel
());
}
// Assert.assertEquals(10, i.getCurrentState().getGoals().size());
}
}
src/test/resources/edu/kit/formal/interpreter/contraposition/testIsClosable.kps
0 → 100644
View file @
e237f563
script t1(){
impRight;
impLeft;
cases{
case match isCloseable:{
impRight; //should not close proof
}
}
}
\ No newline at end of file
src/test/resources/edu/kit/formal/interpreter/javaExample/test.kps
View file @
e237f563
script t1(){
symbex;
cases{
case match
isCloseable
:{
a
ndRight; //should not close proof
case match
'.*x.*'
:{
a
uto;
}
// case match `T >= 0 ==> ` using[ ?T:int]:{
// auto;
// }
default{
auto;
}
}
}
src/test/resources/edu/kit/formal/interpreter/javaExample/testIsClosable.kps
View file @
e237f563
script t1(){
symbex;
cases{
case match
'.*x.*'
:{
a
uto;
case match
isCloseable
:{
a
ndRight; //should not close proof
}
// case match `T >= 0 ==> ` using[ ?T:int]:{
// auto;
// }
default{
auto;
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment