Ticket #2 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

Comparing two records is ugly

Reported by: fumanchu Owned by: fumanchu
Priority: major Milestone: 1.0
Component: assertions Keywords:
Cc:

Description

Example:

    v_base_trans := test._make_typical_transaction();
    v_record := "inner".get_transaction_complete_info(v_base_trans.transaction_id);
    
    FOR colname IN SELECT
      'transaction_id', 'title', 'description', 'price',
      'quantity'
    LOOP
      PERFORM 'PERFORM test.assert_equal(v_record.' || colname || ', v_base_trans.' || colname || ');';
    END LOOP;

The "PERFORM PERFORM" syntax is a horrible thing to remember how to do.

Change History

Changed 3 years ago by fumanchu

  • status changed from new to closed
  • resolution set to fixed

Fixed in [14]. Example:

    v_base_trans := global('test._make_typical_transaction()');
    v_record := global('"inner".get_transaction_complete_info(' || v_base_trans.transaction_id || ')');
    
    FOR name IN SELECT attname FROM attributes(v_record.tablename) WHERE attname NOT LIKE E'%\_epoch'
    LOOP
      PERFORM test.assert_values(v_record.tablename, v_base_trans.tablename, name);
    END LOOP;
Note: See TracTickets for help on using tickets.