@@ -7660,7 +7660,7 @@ def test_dash_s_unclosed_list(self):
7660
7660
7661
7661
def test_dash_s_valid_list(self):
7662
7662
err = self.expect_fail([EMCC, test_file('hello_world.cpp'), "-sTEST_KEY=[Value1, \"Value2\"]"])
7663
- self.assertNotContained('a problem occurred in evaluating the content after a "-s", specifically ', err)
7663
+ self.assertNotContained('error parsing "-s" setting ', err)
7664
7664
7665
7665
def test_dash_s_wrong_type(self):
7666
7666
err = self.expect_fail([EMCC, test_file('hello_world.cpp'), '-sEXIT_RUNTIME=[foo,bar]'])
@@ -7692,6 +7692,15 @@ def test_dash_s_hex(self):
7692
7692
# Ensure that 0x0 is parsed as a zero and not as the string '0x0'.
7693
7693
self.run_process([EMCC, test_file('hello_world.c'), '-nostdlib', '-sERROR_ON_UNDEFINED_SYMBOLS=0x0'])
7694
7694
7695
+ def test_dash_s_bad_json_types(self):
7696
+ # Dict rather than string/list
7697
+ err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS={"a":1}'])
7698
+ self.assertContained("settings must be strings or lists (not $<class 'dict'>", err)
7699
+
7700
+ # List element is not a string
7701
+ err = self.expect_fail([EMCC, test_file('hello_world.c'), '-sEXPORTED_FUNCTIONS=[{"a":1}]'])
7702
+ self.assertContained("list members in settings must be strings (not $<class 'dict'>)", err)
7703
+
7695
7704
def test_zeroinit(self):
7696
7705
create_file('src.c', r'''
7697
7706
#include <stdio.h>
0 commit comments