add recusion and infinite loop tests

This commit is contained in:
Vincent Sanders 2013-05-22 17:31:31 +01:00
parent ce0fe06349
commit 7f7ff93745
3 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<html>
<head>
<title>Infinite loop</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1>Infinite loop</h1>
<p>Before</p>
<script>
function bar(x) { return (x/2) + 1; }
n=1;
while (n < 3) {
n = bar(n);
}
</script>
</script>
<p>Afterwards</p>
</body>
</html>

View File

@ -0,0 +1,21 @@
<html>
<head>
<title>Infinite recursion</title>
<link rel="stylesheet" type="text/css" href="tst.css">
</head>
<body>
<h1>Infinite recursion</h1>
<p>Before</p>
<script>
function it_keeps_going_and_going_and_going(i) {
return it_keeps_going_and_going_and_going(i+1);
}
it_keeps_going_and_going_and_going(1)
</script>
</script>
<p>Afterwards</p>
</body>
</html>

View File

@ -6,6 +6,12 @@
<body>
<h1>JavaScript Tests</h1>
<h2>Core</h2>
<ul>
<li><a href="core.recursion.html">Infinite Recursion</a></li>
<li><a href="core.infinite.html">Infinite loop</a></li>
</ul>
<h2>Window</h2>
<ul>