File:  [CENS] / python / pyGiNaC / test4 / test_wildcard.py
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Nov 27 18:42:10 2001 UTC (16 years ago) by pearu
Branches: MAIN
CVS tags: HEAD
Implemented wildcard.

#!/usr/bin/env python
"""
  test_wildcard - run ginac.wildcard tests.
  Usage:
    python test_wildcard.py [-v]
"""
"""
  This file is part of the PyGiNaC package.
  http://cens.ioc.ee/projects/pyginac/

  $Revision: 1.1 $
  $Id: test_wildcard.py,v 1.1 2001-11-27 18:42:10 pearu Exp $
 
  Copyright 2001 Pearu Peterson all rights reserved,
  Pearu Peterson <pearu@cens.ioc.ee>
  Permission to use, modify, and distribute this software is given under the
  terms of the LGPL.  See http://www.fsf.org
 
  NO WARRANTY IS EXPRESSED OR IMPLIED.  USE AT YOUR OWN RISK.
"""

import test_all
import ginac

class test_wildcard(ginac.wildcard):
    """
    >>> test_save (w=wildcard(34))
    """
    def __init__(self):
        """
        >>> wildcard(1)
        wildcard(1)
        """
    def get_label (self):
        """
        >>> w.get_label ()
        34
        """
    def __nonzero__ (self):
        """
        >>> not w
        0
        """
    def __repr__ (self):
        """
        >>> w
        wildcard(34)
        """
    def __str__ (self):
        """
        >>> str (w)
        '$34'
        """
    def eval (self):
        """
        >>> w.eval ()
        wildcard(34)
        """
    def evalf (self):
        """
        >>> w.evalf ()
        wildcard(34)
        """
    def evalm (self):
        """
        >>> w.evalm ()
        wildcard(34)
        """
    def extract_archived (self):
        """
        >>> w.extract_archived ()
        {'label': [34L], 'class': 'wildcard'}
        """
    def get_class_name (self):
        """
        >>> w.get_class_name ()
        'wildcard'
        """
    def get_hash (self):
        """
        >>> w.get_hash() == wildcard (34).get_hash ()
        1
        >>> type (w.get_hash ()) is type (0)
        1
        """
    def get_precedence (self):
        """
        >>> w.get_precedence ()
        70
        """
    def has (self):
        """
        >>> w.has (w)
        1
        >>> w.has (1)
        0
        """
    def is_equal (self):
        """
        >>> w.is_equal (w)
        1
        >>> w.is_equal (wildcard (34))
        1
        >>> w.is_equal (wildcard (35))
        0
        >>> w.is_equal (34)
        0
        """
    def is_function (self):
        """
        >>> w.is_function ()
        0
        """
    def is_zero (self):
        """
        >>> w.is_zero ()
        0
        """
    def nops (self):
        """
        >>> w.nops ()
        0
        """
    def op (self):
        """
        >>> w.op (0)
        Traceback (most recent call last):
        ...
        IndexError: op(): index out of range
        """
    def to_context (self):
        """
        >>> w.to_context ()
        '$34'
        >>> w.to_context ('latex')
        '$34'
        """
    def to_list (self):
        """
        >>> w.to_list ()
        []
        """
    def swap (self):
        """
        >>> v=wildcard (78)
        >>> w.swap (v)
        >>> w,v
        (wildcard(78), wildcard(34))
        >>> w.swap (v)
        >>> w,v
        (wildcard(34), wildcard(78))
        """
def _test():
    import test_wildcard
    return test_all.test(test_wildcard)

if __name__ == "__main__":
    _test()

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>