Skip to content

IsMSISlice() doesn't work properly #7

@an2deg

Description

@an2deg

Hi!

I have the following JSON structure:

{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}

And method IsMSISlice() returns false. Test:

    json, err := objx.FromJSON(`{"d":[{"author":{"displayName":"DemoUser3","id":2},"classes":null,"id":9879,"v":{"code":"","created":"2013-09-19T09:38:50+02:00","published":"0001-01-01T00:00:00Z","updated":"2013-09-19T09:38:50+02:00"}}],"s":200}`)

    if !assert.NoError(t, err, "Can't decode output") {
        return
    }
    assert.True(t, json.Has("d"), json.MustJSON())

    if !assert.True(t, json.Get("d").IsMSISlice(), json.MustJSON()) {
        return
    }
    if !assert.Equal(t, 1, len(json.Get("d").MSISlice()), "...") {
        return
    }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions