File:  [parser3project] / parser3 / tests / 330.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Wed May 11 22:32:11 2016 UTC (10 years, 3 months ago) by moko
Branches: MAIN
CVS tags: HEAD
test for incomplete finally execution when break occures added (related to issue #1077)

@main[]

1. break in try with catch and finally
^while(1){
	^try{
		$a[aa^break[]bb]
		^throw[;x]
	}{
		catch!
		$exception.handled(1)
		^method[1]
		^method[2]
	}{
		finally!
		^method[1]
		^method[2]
	}
	brake happend.
}
break moment: $a

2. break in try with finally
^while(1){
	^try{
		^break[]
	}{}{
		finally!
		^method[1]
		^method[2]
	}
	brake happend.
}

3. break in try with finally and inactive catch
^while(1){
	^try{
		^break[]
	}{
		catch!
	}{
		finally!
		^method[1]
		^method[2]
	}
	brake happend.
}

4. break in catch with finally
^while(1){
	^try{
		^throw[;x]
	}{
		catch!
		$exception.handled(1)
		^break[]
		^method[1]
	}{
		finally!
		^method[1]
		^method[2]
	}
	brake happend.
}

5. continue in catch with break in finally
^while(1){
	^try{
		^throw[;x]
	}{
		catch!
		$exception.handled(1)
		^continue[]
		^method[1]
	}{
		finally!
		^method[1]
		^method[2]
		^break[]
		^method[3]
	}
	brake happend.
}

6. break in nested try with finally inside
^while(1){
	^try{
		^try{
			$a[aa^break[]bb]
			^throw[;x]
		}{}{
			$finally[finally!
			^method[1]
			^method[2]]
		}
	}{
		catch!
		$exception.handled(1)
		^method[1]
		^method[2]
	}
	brake happend.
}
$finally

@method[n]
call number $n

E-mail: