Skip to content

test maps#18

Draft
mhmd-azeez wants to merge 2 commits intomainfrom
test-maps
Draft

test maps#18
mhmd-azeez wants to merge 2 commits intomainfrom
test-maps

Conversation

@mhmd-azeez
Copy link
Copy Markdown
Contributor

Comment thread mock/main.go
pdk.SetError(err)
return 0
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that we link the test imports (e.g. assert, etc) into XTP Tests, I wonder if it would be worthwhile to run assertions on the kv pairs, doing a type assertion inside the mock here too?

e.g.

import (
    xtptest "github.com/dylibso/xtp-test-go"
)
...

a, ok := obj["keyFromJs"].(int)
xtptest.AssertEq("reflectMapHost preserved map int value", a, 42)

...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work, assuming all the xtp CLI PRs are merged and the latest version is relased

Comment thread mock/main.go
return 0
}

fmt.Println(k)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From an older commit, but does this Println need to be here?

Comment thread mock/main.go
if err != nil {
pdk.SetError(err)
return 0
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above re: adding the tests for type conversion / assertion now that the test module imports are linked.

@bhelx bhelx marked this pull request as draft October 28, 2024 15:13
@bhelx
Copy link
Copy Markdown
Contributor

bhelx commented Oct 28, 2024

converted to draft until we finish refactor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants