Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion mathics/builtin/datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ class DateDifference(Builtin):
"""

# FIXME: Since timedelta does not use large time units (years, months etc)
# this method can be innacuarate. The example below gives fractional Days
# this method can be inaccurate. The example below gives fractional Days
# (20.1666666667 not 20).

"""
Expand Down
4 changes: 2 additions & 2 deletions test/builtin/atomic/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ def test_alphabet(str_expr, str_expected, fail_msg, warnings):
"StringContainsQ[{A, Galaxy, Far, Far, Away}, {F ~~ __ ~~ r, aw ~~ ___}]",
None,
),
## Mathematica can detemine correct invalid element in the pattern, it reports error:
## Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}.
# Mathematica can determine correct invalid element in the pattern, it reports error:
# Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}.
(
'StringRepeat["x", 0]',
("A positive integer is expected at position 2 in StringRepeat[x, 0].",),
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/calculus/test_integrate.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_integrate():
(
"h=x;Integrate[Do[h=x*h,{5}]; h,x]",
"x^7/7",
"a more agressive SymPy translation.",
"a more aggressive SymPy translation.",
),
):
session.evaluate("Clear[h]; Clear[g]; Clear[f];")
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/list/test_eol.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"x=.;a=.;b=.;c=.;f=.; g=.;d=.;m=.;n=.;Delete[1 + x ^ (a + b + c), {2, 2, 3}]",
None,
"1 + x ^ (a + b)",
"Faiing?",
"Failing?",
),
("Delete[f[a, g[b, c], d], {{2}, {2, 1}}]", None, "f[a, d]", None),
(
Expand Down
14 changes: 7 additions & 7 deletions test/builtin/numbers/test_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_collect():

def test_coefficient():
for str_expr, str_expected in (
# Form 1: Coefficent[expr, form]
# Form 1: Coefficient[expr, form]
(
"Coefficient[(x + 2)/(y - 3) + (x + 3)/(y - 2), z, 0]",
"(2 + x) / (-3 + y) + (3 + x) / (-2 + y)",
Expand All @@ -50,7 +50,7 @@ def test_coefficient():
"Coefficient[x^3 - 2 x/y + 3 x z, y]",
"0",
),
# Form 2: Coefficent[expr, form, n]
# Form 2: Coefficient[expr, form, n]
(
"Coefficient[x^2 + axy^2 - bSin[c], c]",
"0",
Expand All @@ -61,7 +61,7 @@ def test_coefficient():

def test_coefficient_list():
for str_expr, str_expected in (
# Form 1: Coefficent[expr, form]
# Form 1: Coefficient[expr, form]
(
"CoefficientList[x^2 + a x y^2 - b Sin[c], y]",
"{-b Sin[c] + x ^ 2, 0, a x}",
Expand Down Expand Up @@ -359,10 +359,10 @@ def test_fullsimplify():
"Coefficient[3 + x + y, 5]",
None,
),
## This is known bug of Sympy 1.0, next Sympy version will fix it by this commit
## https://github.com/sympy/sympy/commit/25bf64b64d4d9a2dc563022818d29d06bc740d47
("Coefficient[x * y, z, 0]", None, "x y", "Sympy 1.0 retuns 0"),
## TODO: Support Modulus
# This is known bug of Sympy 1.0, next Sympy version will fix it by this commit
# https://github.com/sympy/sympy/commit/25bf64b64d4d9a2dc563022818d29d06bc740d47
("Coefficient[x * y, z, 0]", None, "x y", "Sympy 1.0 returns 0"),
# TODO: Support Modulus
# ("Coefficient[(x + 2)^3 + (x + 3)^2, x, 0, {Modulus -> 3, Modulus -> 2, Modulus -> 10}]",
# None,"{2, 1, 7}", None),
(
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/numbers/test_diffeqns.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"DSolve[f[x] == 0, f, {}]",
None,
),
# # Order of arguments shoudn't matter
# Order of arguments should not matter
(
"DSolve[D[f[x, y], x] == D[f[x, y], y], f, {x, y}]",
None,
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/numbers/test_nintegrate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""
Unit tests for mathics.buitin.numbers.nintegrate
Unit tests for mathics.builtin.numbers.nintegrate

NIntegrate[] tests

Expand Down
18 changes: 9 additions & 9 deletions test/builtin/test_comparison.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
("g[a]<g[a]", "g[a] < g[a]", "not comparable expressions (like in WMA)"),
("g[1]<g[1]", "g[1] < g[1]", "not comparable expressions (like in WMA)"),
#
('Wo["x"]>3', "Wo[x] > 3", "isue #797"),
('Wo["x"]<3', "Wo[x] < 3", "isue #797"),
('Wo["x"]==3', "Wo[x] == 3", "isue #797"),
('3>Wo["x"]', "3 > Wo[x]", "isue #797"),
('3<Wo["x"]', "3 < Wo[x]", "isue #797"),
('3==Wo["x"]', "3 == Wo[x]", "isue #797"),
('Wo[f["x"],2]>0', "Wo[f[x], 2] > 0", "isue #797"),
('Wo["x"]>3', "Wo[x] > 3", "issue #797"),
('Wo["x"]<3', "Wo[x] < 3", "issue #797"),
('Wo["x"]==3', "Wo[x] == 3", "issue #797"),
('3>Wo["x"]', "3 > Wo[x]", "issue #797"),
('3<Wo["x"]', "3 < Wo[x]", "issue #797"),
('3==Wo["x"]', "3 == Wo[x]", "issue #797"),
('Wo[f["x"],2]>0', "Wo[f[x], 2] > 0", "issue #797"),
#
# chained compare
("a != a != b", "False", "Strange MMA behavior"),
Expand Down Expand Up @@ -180,8 +180,8 @@ def test_sameq(str_lhs, str_rhs, str_expected):
[ # UnsameQ returns True with 0 or 1 arguments
("UnsameQ[]", "True"),
("UnsameQ[expr]", "True"),
# With 2 or more argments, UnsameQ returns True if all expressions are
# structurally distinct and False otherwise
# With 2 or more arguments, UnsameQ returns True if all
# expressions are structurally distinct and False otherwise
("x =!= x", "False"),
("x =!= y", "True"),
("1 =!= 2 =!= 3 =!= 4", "True"),
Expand Down
15 changes: 9 additions & 6 deletions test/builtin/test_datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,19 @@ def test_timeremaining():
def test_timeconstrained1():
"""
This test checks that
* TimeConstrained manages to return $Aborted when the

- ``TimeConstrained`` manages to return ``$Aborted`` when the
evaluated expression exceeds the walltime.
* That the evaluation does not proceeds after the walltime.

If `Pause` and TimeConstrained were absolutely accurate,
- That the evaluation does not proceed after the walltime.

If ``Pause`` and ``TimeConstrained`` were absolutely accurate,
`a` should be always less than 11. However, sometimes
the innacuracies in time could allow to reach more than 10
iterations before get stopped. 20 iterations should be a safe
the inaccuracies in time could allow to reach more than 10
iterations before being stopped. 20 iterations should be a safe
bound.
After `TimeConstrained` returns `$Abort`, iterations should stop,

After ``TimeConstrained`` returns ``$Abort``, iterations should stop,
so if we check one second after the end of the evaluation, `a`
should not change its value.
"""
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/test_makeboxes.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def test_makeboxes_others_fail(str_expr, str_expected, msg):
(
r"MakeBoxes[G[F[2.]], StandardForm]",
r'RowBox[{"G","[",RowBox[{"F","[","2.","]"}],"]"}]',
"Standard bahaviour",
"Standard behaviour",
),
(
r'MakeBoxes[F[x_], fmt_] := "F[" <> ToString[x] <> "]";MakeBoxes[G[F[3.002]], StandardForm]',
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/test_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def test_replace_all():
"Dispatch[]",
"dispatch with 0 arguments",
),
("Dispatch[a]", None, "Dispatch[a]", "A simbol. Keep unevaluated."),
("Dispatch[a]", None, "Dispatch[a]", "A symbol. Keep unevaluated."),
("Dispatch[a -> b]", None, "Dispatch[<1>]", "single rule"),
("Dispatch[{}]", None, "{}", "empty rule"),
("Dispatch[{a -> 1}]", None, "Dispatch[<1>]", "single rule"),
Expand Down
4 changes: 2 additions & 2 deletions test/builtin/test_strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ def test_private_doctests_operations(str_expr, msgs, str_expected, fail_msg):
"StringFreeQ[{A, Galaxy, Far, Far, Away}, {F ~~ __ ~~ r, aw ~~ ___}]",
None,
),
## Mathematica can detemine correct invalid element in the pattern, it reports error:
## Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}.
# Mathematica can determine correct invalid element in the pattern, it reports error:
# Element F is not a valid string or pattern element in {F ~~ __ ~~ r, aw ~~ ___}.
('StringMatchQ["abc1", LetterCharacter]', None, "False", None),
('StringMatchQ["abc", "ABC"]', None, "False", None),
('StringMatchQ["abc", "ABC", IgnoreCase -> True]', None, "True", None),
Expand Down
2 changes: 1 addition & 1 deletion test/core/test_streams.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def test_path_search():
for expect_find, expect_temporary, filename, assert_msg in (
(True, False, "fortytwo`", "should find with .m extension"),
(False, False, "fortytwo", "should not find without backtick (`) added"),
(True, False, "recursive-gcd`", "should find wit .wl extension"),
(True, False, "recursive-gcd`", "should find with .wl extension"),
):
resolved_file, is_temporary = path_search(filename)
assert expect_find == bool(resolved_file), assert_msg
Expand Down
2 changes: 1 addition & 1 deletion test/eval/test_patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def check_pattern(str_expr, str_pattern):
expr = parse(defintions, MathicsSingleLineFeeder(str_expr))
pattern = ExpressionPattern(parse(defintions, MathicsSingleLineFeeder(str_pattern)))
ret = Matcher(pattern, session.evaluation).match(expr, session.evaluation)
assert ret == True
assert ret is True


@pytest.mark.parametrize(
Expand Down
Loading