Skip to content

Commit 657ac05

Browse files
committed
Add a test for the Depth package
1 parent 06476ec commit 657ac05

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

M2/Macaulay2/packages/Depth.m2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,16 @@ I = ideal vars T;
112112
assert( depth(I,T) === 0 )
113113
assert( depth(I,T^1) === 0 )
114114
assert( depth T === 0 )
115+
///
116+
117+
TEST///
118+
S = ZZ/101[x_1..x_(9)];
119+
J = ideal(x_1,x_2,x_3,x_4,x_5,x_6,x_7,x_8);
120+
T = S/J^3; -- The ring T has dimension 1, not 0 as in the previous test.
121+
I = ideal vars T;
122+
assert( depth(I,T) === 1 )
123+
assert( depth(I,T^1) === 1 )
124+
assert( depth T === 1 )
115125
///
116126

117127
TEST///
@@ -171,6 +181,7 @@ time depth(ideal vars S, S^1)
171181
depth(Module) := ZZ => M -> (
172182
--depth of a module with respect to the max ideal, via finite proj dim
173183
--gives error if the ultimate coefficient ring of R = ring M is not a field.
184+
if dim M === 0 then return 0;
174185
R := ring M;
175186
if isHomogeneous M === false then print "-- Warning: This module is not homogeneous, computation may be incorrect.";
176187
if not isCommutative R then error"depth undefined for noncommutative rings";

0 commit comments

Comments
 (0)