aboutsummaryrefslogtreecommitdiff
path: root/tests/test_core.py
diff options
context:
space:
mode:
authorVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 15:11:25 +0200
committerVasilis Kalintiris <ehostunreach@gmail.com>2013-12-07 19:35:59 +0200
commit0f29e3b614008e8c1e3fe1caa146b086485efbf7 (patch)
treee2c3432b65ccd4460206a7098f595cdc596f2c7b /tests/test_core.py
parent4b92d25e002a3035d19fe54c240938843b0679b6 (diff)
Use do_run_from_file() for test_printf_more
Diffstat (limited to 'tests/test_core.py')
-rw-r--r--tests/test_core.py18
1 files changed, 4 insertions, 14 deletions
diff --git a/tests/test_core.py b/tests/test_core.py
index 5b8976b7..20d79a47 100644
--- a/tests/test_core.py
+++ b/tests/test_core.py
@@ -3608,20 +3608,10 @@ ok
self.do_run_from_file(src, output)
def test_printf_more(self):
- src = r'''
- #include <stdio.h>
- int main() {
- int size = snprintf(NULL, 0, "%s %d %.2f\n", "me and myself", 25, 1.345);
- char buf[size];
- snprintf(buf, size, "%s %d %.2f\n", "me and myself", 25, 1.345);
- printf("%d : %s\n", size, buf);
- char *buff = NULL;
- asprintf(&buff, "%d waka %d\n", 21, 95);
- puts(buff);
- return 0;
- }
- '''
- self.do_run(src, '22 : me and myself 25 1.34\n21 waka 95\n')
+ test_path = path_from_root('tests', 'core', 'test_printf_more')
+ src, output = (test_path + s for s in ('.in', '.out'))
+
+ self.do_run_from_file(src, output)
def test_perrar(self):
src = r'''