@@ -7651,7 +7651,7 @@ def test_dash_s_unclosed_list(self):
7651
7651
7652
7652
def test_dash_s_valid_list(self):
7653
7653
err = self.expect_fail([EMCC, test_file('hello_world.cpp'), "-sTEST_KEY=[Value1, \"Value2\"]"])
7654
- self.assertNotContained('a problem occurred in evaluating the content after a "-s", specifically ', err)
7654
+ self.assertNotContained('error parsing "-s" setting ', err)
7655
7655
7656
7656
def test_dash_s_wrong_type(self):
7657
7657
err = self.expect_fail([EMCC, test_file('hello_world.cpp'), '-sEXIT_RUNTIME=[foo,bar]'])
@@ -7683,6 +7683,15 @@ def test_dash_s_hex(self):
7683
7683
# Ensure that 0x0 is parsed as a zero and not as the string '0x0'.
7684
7684
self.run_process([EMCC, test_file('hello_world.c'), '-nostdlib', '-sERROR_ON_UNDEFINED_SYMBOLS=0x0'])
7685
7685
7686
+ def test_dash_s_bad_json_types(self):
7687
+ # Dict rather than string/list
7688
+ err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS={"a":1}'])
7689
+ self.assertContained("setting must be parse as string or list (not $<class 'dict'>", err)
7690
+
7691
+ # List element is not a string
7692
+ err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=[{"a":1}]'])
7693
+ self.assertContained("list members in settings must be strings (not $<class 'dict'>)", err)
7694
+
7686
7695
def test_zeroinit(self):
7687
7696
create_file('src.c', r'''
7688
7697
#include <stdio.h>
0 commit comments