예제 #1
0
    def testCPUPHP(self):
        """Should be able to note CPU fatal error (in PHP)."""

        # This test intentionally takes a few seconds to run.

        # Code is originally from
        # https://scraperwiki.com/scrapers/cpu-php/edit/
        code = """<?php
echo "php started\n";
set_time_limit(1);
$x=2;
while(true) {
    $a = $x*$x;
}
?>
"""

        stuff = self.Execute(code, language='php')
        output = testbase.exceptions(stuff)
        assert 'Maximum execution time' in output
예제 #2
0
    def testCPUPHP(self):
        """Should be able to note CPU fatal error (in PHP)."""

        # This test intentionally takes a few seconds to run.

        # Code is originally from
        # https://scraperwiki.com/scrapers/cpu-php/edit/
        code = """<?php
echo "php started\n";
set_time_limit(1);
$x=2;
while(true) {
    $a = $x*$x;
}
?>
"""

        stuff = self.Execute(code, language='php')
        output = testbase.exceptions(stuff)
        assert 'Maximum execution time' in output
예제 #3
0
 def testBinaryAssert(self):
     """Should be able to see assert text, even when non UTF-8."""
     stuff = self.Execute(r"""assert '','\xabAsserted\xbb'""")
     output = testbase.exceptions(stuff)
     assert "Asserted" in output
예제 #4
0
 def testBinaryAssert(self):
     """Should be able to see assert text, even when non UTF-8."""
     stuff = self.Execute(r"""assert '','\xabAsserted\xbb'""")
     output = testbase.exceptions(stuff)
     assert 'Asserted' in output