@@ -30,6 +30,11 @@ def file_bas():
3030 return os .path .join (PATH , 'empty.bas' )
3131
3232
33+ @pytest .fixture
34+ def config_file ():
35+ return os .path .join (PATH , 'config_sample.ini' )
36+
37+
3338@pytest .fixture
3439def file_bin ():
3540 return os .path .join (PATH , 'empty.bin' )
@@ -49,3 +54,20 @@ def test_org_allows_0xnnnn_format(file_bas, file_bin):
4954 with EnsureRemoveFile (file_bin ):
5055 zxbc .main (['--parse-only' , '--org' , '0xC000' , file_bas , '-o' , file_bin ])
5156 assert zxbc .OPTIONS .org == 0xC000 , 'Should set ORG to 0xC000'
57+
58+
59+ def test_org_loads_ok_from_config_file_format (file_bas , file_bin , config_file ):
60+ """ Should allow hexadecimal format 0x in org
61+ """
62+ with EnsureRemoveFile (file_bin ):
63+ zxbc .main (['--parse-only' , '-F' , config_file , file_bas , '-o' , file_bin ])
64+ assert zxbc .OPTIONS .org == 31234 , 'Should set ORG to 31234'
65+
66+
67+ def test_cmdline_should_override_config_file (file_bas , file_bin , config_file ):
68+ """ Should allow hexadecimal format 0x in org
69+ """
70+ with EnsureRemoveFile (file_bin ):
71+ zxbc .main (['--parse-only' , '-F' , config_file , '--org' , '1234' , file_bas , '-o' , file_bin ])
72+ assert zxbc .OPTIONS .org == 1234 , 'Commandline should override config file'
73+ assert zxbc .OPTIONS .optimization_level == 3 , 'Commandline should override config file'
0 commit comments