@@ -771,14 +771,17 @@ describe('Unit', function () {
771771
772772 it ( 'should format a Complex unit' , function ( ) {
773773 assert . strictEqual ( new Unit ( math . complex ( - 2 , 4.5 ) , 'mm' ) . format ( 14 ) , '(-2 + 4.5i) mm' )
774+ assert . strictEqual ( new Unit ( math . complex ( 1 ) , 'kW' ) . format ( 14 ) , '1 kW' )
775+ assert . strictEqual ( new Unit ( math . complex ( 0 , 1 ) , 'kW' ) . format ( 14 ) , 'i kW' )
776+ assert . strictEqual ( new Unit ( math . complex ( 0 , 2 ) , 'kW' ) . format ( 14 ) , '2i kW' )
774777 } )
775778
776779 it ( 'should format units with VA and VAR correctly' , function ( ) {
777780 assert . strictEqual ( math . evaluate ( '4000 VAR + 3000 VA' ) . format ( ) , '(3 + 4i) kVA' )
778781 assert . strictEqual ( math . evaluate ( '3000 VA + 4000 VAR' ) . format ( ) , '(3 + 4i) kVA' )
779- assert . strictEqual ( math . evaluate ( '4000 VAR' ) . format ( ) , '(4) kVAR' )
780- assert . strictEqual ( math . evaluate ( '4000i VA' ) . format ( ) , '(4) kVAR' )
781- assert . strictEqual ( math . evaluate ( '4000i VAR' ) . format ( ) , '(-4) kVA' )
782+ assert . strictEqual ( math . evaluate ( '4000 VAR' ) . format ( ) , '4 kVAR' )
783+ assert . strictEqual ( math . evaluate ( '4000i VA' ) . format ( ) , '4 kVAR' )
784+ assert . strictEqual ( math . evaluate ( '4000i VAR' ) . format ( ) , '-4 kVA' )
782785 assert . strictEqual ( math . evaluate ( 'abs(4000 VAR + 3000 VA)' ) . format ( ) , '5 kW' )
783786 assert . strictEqual ( math . evaluate ( 'abs(3000 VA + 4000 VAR)' ) . format ( ) , '5 kW' )
784787 assert . strictEqual ( math . evaluate ( 'abs(4000 VAR)' ) . format ( ) , '4 kW' )
0 commit comments