@@ -13,13 +13,13 @@ func TestEntry_WithFields(t *testing.T) {
1313 qt .Assert (t , a .Fields , qt .IsNil )
1414
1515 b := a .WithFields (Fields {{"foo" , "bar" }})
16- qt .Assert (t , a .mergedFields (), qt .IsNil )
16+ qt .Assert (t , a .distinctFieldsLastByName (), qt .IsNil )
1717
1818 c := a .WithFields (Fields {{"foo" , "hello" }, {"bar" , "world" }})
1919 d := c .WithFields (Fields {{"baz" , "jazz" }})
20- qt .Assert (t , b .mergedFields (), qt .DeepEquals , Fields {{"foo" , "bar" }})
21- qt .Assert (t , c .mergedFields (), qt .DeepEquals , Fields {{"foo" , "hello" }, {"bar" , "world" }})
22- qt .Assert (t , d .mergedFields (), qt .DeepEquals , Fields {{"foo" , "hello" }, {"bar" , "world" }, {"baz" , "jazz" }})
20+ qt .Assert (t , b .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"foo" , "bar" }})
21+ qt .Assert (t , c .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"foo" , "hello" }, {"bar" , "world" }})
22+ qt .Assert (t , d .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"foo" , "hello" }, {"bar" , "world" }, {"baz" , "jazz" }})
2323
2424 e := c .finalize (InfoLevel , "upload" )
2525 qt .Assert (t , "upload" , qt .Equals , e .Message )
@@ -31,24 +31,24 @@ func TestEntry_WithFields(t *testing.T) {
3131func TestEntry_WithField (t * testing.T ) {
3232 a := NewEntry (nil )
3333 b := a .WithField ("foo" , "baz" ).WithField ("foo" , "bar" )
34- qt .Assert (t , a .mergedFields (), qt .IsNil )
35- qt .Assert (t , b .mergedFields (), qt .DeepEquals , Fields {{"foo" , "bar" }})
34+ qt .Assert (t , a .distinctFieldsLastByName (), qt .IsNil )
35+ qt .Assert (t , b .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"foo" , "bar" }})
3636}
3737
3838func TestEntry_WithError (t * testing.T ) {
3939 a := NewEntry (nil )
4040 b := a .WithError (fmt .Errorf ("boom" ))
41- qt .Assert (t , a .mergedFields (), qt .IsNil )
42- qt .Assert (t , b .mergedFields (), qt .DeepEquals , Fields {{"error" , "boom" }})
41+ qt .Assert (t , a .distinctFieldsLastByName (), qt .IsNil )
42+ qt .Assert (t , b .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"error" , "boom" }})
4343}
4444
4545func TestEntry_WithError_fields (t * testing.T ) {
4646 a := NewEntry (nil )
4747 b := a .WithError (errFields ("boom" ))
48- qt .Assert (t , a .mergedFields (), qt .IsNil )
48+ qt .Assert (t , a .distinctFieldsLastByName (), qt .IsNil )
4949 qt .Assert (t ,
5050
51- b .mergedFields (), qt .DeepEquals , Fields {
51+ b .distinctFieldsLastByName (), qt .DeepEquals , Fields {
5252 {"error" , "boom" },
5353 {"reason" , "timeout" },
5454 })
@@ -58,14 +58,14 @@ func TestEntry_WithError_fields(t *testing.T) {
5858func TestEntry_WithError_nil (t * testing.T ) {
5959 a := NewEntry (nil )
6060 b := a .WithError (nil )
61- qt .Assert (t , a .mergedFields (), qt .IsNil )
62- qt .Assert (t , b .mergedFields (), qt .IsNil )
61+ qt .Assert (t , a .distinctFieldsLastByName (), qt .IsNil )
62+ qt .Assert (t , b .distinctFieldsLastByName (), qt .IsNil )
6363}
6464
6565func TestEntry_WithDuration (t * testing.T ) {
6666 a := NewEntry (nil )
6767 b := a .WithDuration (time .Second * 2 )
68- qt .Assert (t , b .mergedFields (), qt .DeepEquals , Fields {{"duration" , int64 (2000 )}})
68+ qt .Assert (t , b .distinctFieldsLastByName (), qt .DeepEquals , Fields {{"duration" , int64 (2000 )}})
6969}
7070
7171type errFields string
0 commit comments