# 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
|
|
11 | 11 | sage: import time |
12 | 12 | sage: tests_dir = os.path.join(SAGE_ROOT, 'devel', 'sage', 'sage', 'doctest', 'tests') |
13 | 13 | |
| 14 | Check 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 | |
14 | 37 | Test the ``--initial`` option:: |
15 | 38 | |
16 | 39 | sage: subprocess.call(["sage", "-t", "-i", "initial.rst"], cwd=tests_dir) # long time |
diff --git a/sage/doctest/tests/longtime.rst b/sage/doctest/tests/longtime.rst
new file mode 100644
-
|
+
|
|
| 1 | Test combining various modifiers:: |
| 2 | |
| 3 | sage: sys.maxint # long time, abs tol 0.01 |
| 4 | 2147483646.999 # 32-bit |
| 5 | 9223372036854775806.999 # 64-bit |
diff --git a/sage/rings/number_field/totallyreal_rel.py b/sage/rings/number_field/totallyreal_rel.py
a
|
b
|
|
66 | 66 | sage: F.<t> = NumberField(ZZx([1,-4,3,1])) |
67 | 67 | sage: F.disc() |
68 | 68 | 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 |
72 | 72 | |
73 | 73 | AUTHORS: |
74 | 74 | |
75 | 75 | - John Voight (2007-11-03): Initial version. |
76 | 76 | """ |
77 | 77 | |
78 | | #*********************************************************************************************** |
| 78 | #***************************************************************************** |
79 | 79 | # Copyright (C) 2007 William Stein and John Voight |
80 | 80 | # |
81 | 81 | # 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. |
90 | 84 | # http://www.gnu.org/licenses/ |
91 | | #*********************************************************************************************** |
| 85 | #***************************************************************************** |
| 86 | |
92 | 87 | |
93 | 88 | from sage.rings.arith import binomial, gcd, divisors |
94 | 89 | from sage.rings.integer import Integer |