From e2ae8801824477ab4d8fd2990cb3f3d5958b54fe Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 10 Feb 2017 14:25:38 +0100 Subject: [PATCH] Test with_transaction.t: deutsche und englische Fehlermeldungen erkennen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit DB-Cluster sind bei uns in Deutschland normalerweise mit englischer oder mit deutscher Locale angelegt. Daher sollte ein Test mit beiden Sprachvarianten genügen. --- t/db_helper/with_transaction.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/db_helper/with_transaction.t b/t/db_helper/with_transaction.t index 6d49a209b..3071cc3d3 100644 --- a/t/db_helper/with_transaction.t +++ b/t/db_helper/with_transaction.t @@ -61,7 +61,7 @@ SL::DB->client->with_transaction(sub { ok 0, 'part saved'; 1; }) or do { - like(SL::DB->client->error, qr/duplicate key value violates unique constraint/, 'error is in db->error'); + like(SL::DB->client->error, qr/unique.constraint/i, 'error is in db->error'); }; # test stacked transactions @@ -127,7 +127,7 @@ SL::DB->client->with_transaction(sub { 1; }) or do { ok 1, 'sql error in nested transaction rolls back'; - like(SL::DB->client->error, qr/duplicate key value violates unique constraint/, 'error from nested transaction is in db->error'); + like(SL::DB->client->error, qr/unique.constraint/i, 'error from nested transaction is in db->error'); }; $part->load; @@ -242,4 +242,3 @@ eval { $part->load; is $part->sellprice, "3.00000", 'saved part is not affected'; - -- 2.20.1