Permalink
Browse files

Fix test failure. TODO and SKIP work properly.

  • Loading branch information...
1 parent c9404db commit 3ea18a762f6ff55fe48410764f7ac16e7694928c @theory committed Jul 28, 2010
Showing with 10 additions and 7 deletions.
  1. +8 −5 mytap.sql
  2. +2 −2 tests/todotap.my
View
@@ -264,9 +264,12 @@ DROP FUNCTION IF EXISTS _get_latest_with_value;
CREATE FUNCTION _get_latest_with_value ( vlabel text, vvalue integer ) RETURNS INTEGER
BEGIN
DECLARE ret integer;
- SELECT MAX(id) INTO ret FROM __tcache__
+ SELECT MAX(id)
+ INTO ret
+ FROM __tcache__
WHERE label = vlabel
- AND value = vvalue;
+ AND value = vvalue
+ AND cid = connection_id();
RETURN ret;
END //
@@ -653,12 +656,12 @@ END //
DROP PROCEDURE IF EXISTS todo_end;
CREATE PROCEDURE todo_end ()
BEGIN
- DECLARE id INTEGER DEFAULT _get_latest_with_value( 'todo', -1 );
+ DECLARE tid INTEGER DEFAULT _get_latest_with_value( 'todo', -1 );
DECLARE trash TEXT;
- IF id IS NULL THEN
+ IF tid IS NULL THEN
SELECT `todo_end() called without todo_start()` INTO trash;
END IF;
- DELETE FROM __tcache__ WHERE id = id;
+ DELETE FROM __tcache__ WHERE id = tid;
END //
DROP FUNCTION IF EXISTS skip;
View
@@ -1,6 +1,6 @@
BEGIN;
--- SELECT tap.plan(18);
-CALL tap.no_plan();
+SELECT tap.plan(21);
+-- CALL tap.no_plan();
/****************************************************************************/
-- Test todo tests.

0 comments on commit 3ea18a7

Please sign in to comment.