Ticket #2235: 2235_long_time.patch

File 2235_long_time.patch, 4.0 KB (added by jdemeyer, 9 years ago)
  • sage/doctest/test.py

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1363171045 -3600
    # Node ID 307f3a73cc1e7c169ba1a511dde2a8a7e2e25bf4
    # Parent  1ad634b7a56593f23e230c8352d4f82e65c4784e
    Test combining various doctest modifiers
    
    diff --git a/sage/doctest/test.py b/sage/doctest/test.py
    a b  
    1111    sage: import time
    1212    sage: tests_dir = os.path.join(SAGE_ROOT, 'devel', 'sage', 'sage', 'doctest', 'tests')
    1313
     14Check that :trac:`2235` has been fixed::
     15
     16    sage: subprocess.call(["sage", "-t", "longtime.rst"], cwd=tests_dir)  # long time
     17    Running doctests...
     18    Doctesting 1 file.
     19    sage -t longtime.rst
     20    [0 tests, ...s]
     21    ----------------------------------------------------------------------
     22    All tests passed!
     23    ----------------------------------------------------------------------
     24    ...
     25    0
     26    sage: subprocess.call(["sage", "-t", "-l", "longtime.rst"], cwd=tests_dir)  # long time
     27    Running doctests...
     28    Doctesting 1 file.
     29    sage -t --long longtime.rst
     30    [1 test, ...s]
     31    ----------------------------------------------------------------------
     32    All tests passed!
     33    ----------------------------------------------------------------------
     34    ...
     35    0
     36
    1437Test the ``--initial`` option::
    1538
    1639    sage: subprocess.call(["sage", "-t", "-i", "initial.rst"], cwd=tests_dir)  # long time
  • new file sage/doctest/tests/longtime.rst

    diff --git a/sage/doctest/tests/longtime.rst b/sage/doctest/tests/longtime.rst
    new file mode 100644
    - +  
     1Test combining various modifiers::
     2
     3    sage: sys.maxint  # long time, abs tol 0.01
     4    2147483646.999            # 32-bit
     5    9223372036854775806.999   # 64-bit
  • sage/rings/number_field/totallyreal_rel.py

    diff --git a/sage/rings/number_field/totallyreal_rel.py b/sage/rings/number_field/totallyreal_rel.py
    a b  
    6666    sage: F.<t> = NumberField(ZZx([1,-4,3,1]))
    6767    sage: F.disc()
    6868    49
    69     sage: enumerate_totallyreal_fields_rel(F, 3, 17*10^9) # not tested
    70     [[16240385609L, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]]    # 32 bit
    71     [[16240385609, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]]    # 64 bit
     69    sage: enumerate_totallyreal_fields_rel(F, 3, 17*10^9)  # not tested, too long time (258s on sage.math, 2013)
     70    [[16240385609L, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]]    # 32-bit
     71    [[16240385609, x^9 - x^8 - 9*x^7 + 4*x^6 + 26*x^5 - 2*x^4 - 25*x^3 - x^2 + 7*x + 1, xF^3 + (-t^2 - 4*t + 1)*xF^2 + (t^2 + 3*t - 5)*xF + 3*t^2 + 11*t - 5]]     # 64-bit
    7272
    7373AUTHORS:
    7474
    7575- John Voight (2007-11-03): Initial version.
    7676"""
    7777
    78 #***********************************************************************************************
     78#*****************************************************************************
    7979#       Copyright (C) 2007 William Stein and John Voight
    8080#
    8181#  Distributed under the terms of the GNU General Public License (GPL)
    82 #
    83 #    This code is distributed in the hope that it will be useful,
    84 #    but WITHOUT ANY WARRANTY; without even the implied warranty of
    85 #    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    86 #    General Public License for more details.
    87 #
    88 #  The full text of the GPL is available at:
    89 #
     82#  as published by the Free Software Foundation; either version 2 of
     83#  the License, or (at your option) any later version.
    9084#                  http://www.gnu.org/licenses/
    91 #***********************************************************************************************
     85#*****************************************************************************
     86
    9287
    9388from sage.rings.arith import binomial, gcd, divisors
    9489from sage.rings.integer import Integer