# HG changeset patch # User thomask # Date 1175761685 0 # Node ID 0c9905dc4158c6d1a5e52db651572c81bb10d223 # Parent 684421d327df11a595b918a99897b8297bdbebb2 switch bug BCS 2007-03-24 news:ce0a334389688c93c3bbfaa07d6@news.digitalmars.com diff -r 684421d327df -r 0c9905dc4158 run/s/switch_24_A.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/switch_24_A.d Thu Apr 05 08:28:05 2007 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ BCS +// @date@ 2007-03-24 +// @uri@ news:ce0a334389688c93c3bbfaa07d6@news.digitalmars.com +// @desc@ switch bug + +module dstress.run.s.switch_24_A; + +int main(){ + int x = 0; + + switch("#!"){ + case "#!": + x++; + break; + case "\xFF\xFE": + assert(0); + break; + default: + assert(0); + break; + } + + if(1 != x){ + assert(0); + } + + return 0; +} + diff -r 684421d327df -r 0c9905dc4158 run/s/switch_24_B.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/switch_24_B.d Thu Apr 05 08:28:05 2007 +0000 @@ -0,0 +1,33 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ BCS +// @date@ 2007-03-24 +// @uri@ news:ce0a334389688c93c3bbfaa07d6@news.digitalmars.com +// @desc@ switch bug + +module dstress.run.s.switch_24_B; + +int main(){ + int x = 0; + + switch("#!"){ + case "#!": + x++; + break; + case "\xFF\xFE"c: + assert(0); + break; + default: + assert(0); + break; + } + + if(1 != x){ + assert(0); + } + + return 0; +} + diff -r 684421d327df -r 0c9905dc4158 run/s/switch_24_C.d --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/run/s/switch_24_C.d Thu Apr 05 08:28:05 2007 +0000 @@ -0,0 +1,30 @@ +// $HeadURL$ +// $Date$ +// $Author$ + +// @author@ BCS +// @date@ 2007-03-24 +// @uri@ news:ce0a334389688c93c3bbfaa07d6@news.digitalmars.com +// @desc@ switch bug + +module dstress.run.s.switch_24_C; + +int main(){ + int x = 0; + + switch("#!"){ + case "#!": + x++; + break; + default: + assert(0); + break; + } + + if(1 != x){ + assert(0); + } + + return 0; +} +