@@ -29,7 +29,7 @@ using NDTensors.GradedAxes:
2929 isdual,
3030 nondual
3131using NDTensors. LabelledNumbers:
32- LabelledInteger, LabelledUnitRange, label, labelled, labelled_isequal, unlabel
32+ LabelledInteger, LabelledUnitRange, label, label_type, labelled, labelled_isequal, unlabel
3333using Test: @test , @test_broken , @testset
3434struct U1
3535 n:: Int
7070 @test ! isdual (la)
7171 @test labelled_isequal (la, la)
7272 @test space_isequal (la, la)
73+ @test label_type (la) == U1
7374
7475 lad = dual (la)
7576 @test lad isa LabelledUnitRangeDual
8485 @test isdual (lad)
8586 @test nondual (lad) === la
8687 @test dual (lad) === la
88+ @test label_type (lad) == U1
89+
90+ laf = flip (la)
91+ @test laf isa LabelledUnitRangeDual
92+ @test label (laf) == U1 (1 )
93+ @test unlabel (laf) == 1 : 2
94+
95+ ladf = flip (dual (la))
96+ @test ladf isa LabelledUnitRange
97+ @test label (ladf) == U1 (- 1 )
98+ @test unlabel (ladf) == 1 : 2
99+
100+ lafd = dual (flip (la))
101+ @test lafd isa LabelledUnitRange
102+ @test label (lafd) == U1 (- 1 )
103+ @test unlabel (lafd) == 1 : 2
87104
88105 # check default behavior for objects without dual
89106 la = labelled (1 : 2 , ' x' )
100117 @test isdual (lad)
101118 @test nondual (lad) === la
102119 @test dual (lad) === la
120+
121+ laf = flip (la)
122+ @test laf isa LabelledUnitRangeDual
123+ @test label (laf) == ' x'
124+ @test unlabel (laf) == 1 : 2
125+
126+ ladf = flip (lad)
127+ @test ladf isa LabelledUnitRange
128+ @test label (ladf) == ' x'
129+ @test unlabel (ladf) == 1 : 2
103130end
104131
105132@testset " GradedUnitRangeDual" begin
0 commit comments