Ignore:
Timestamp:
Sep 5, 2008, 5:50:10 AM (17 years ago)
Author:
bird
Message:

kmk/expreval.c: Added conversion operators: num, string and bool. Consoliated some assertions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/testcase-ifcond.kmk

    r1728 r1729  
    721721# bool
    722722#
    723 
    724 
    725 #
    726 # string
    727 #
     723$(warning unary operator: bool )
     724if bool("Asdf") != 1
     725$(error )
     726endif
     727if bool("") != 0
     728$(error )
     729endif
     730
     731
     732#
     733# bool
     734#
     735$(warning unary operator: num )
     736if num("1234") != 1235 - 1
     737$(error )
     738endif
     739if num('1234') != 1233 + 1
     740$(error )
     741endif
     742
     743
     744#
     745# str
     746#
     747$(warning unary operator: str )
     748if str(a < b) != 1
     749$(error )
     750endif
     751if str(a < b) != '1'
     752$(error )
     753endif
     754if str( 1 ) != "1"
     755$(error )
     756endif
     757if str( 1 ) != "1"
     758$(error )
     759endif
     760if str( num(0x1000) ) != "4096"
     761$(error )
     762endif
     763if str(0x1000) != 0x1000
     764$(error )
     765endif
    728766
    729767
Note: See TracChangeset for help on using the changeset viewer.