Skip to content
This repository has been archived by the owner on Oct 1, 2022. It is now read-only.

Testing with odk-xpath lib #87

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

MartijnR
Copy link
Member

No description provided.

@MartijnR
Copy link
Member Author

@vimemo please see comments above. There only seem to be a few important tests remaining. Most are not important. I'm guessing many of these tests have the same fix. Very cool! 👍

@vimemo
Copy link

vimemo commented Aug 1, 2019

hi @MartijnR, I am not able to see your comments for some reason. Am I missing something?

test/spec/axis-native.spec.js Show resolved Hide resolved
test/spec/axis-native.spec.js Show resolved Hide resolved
test/spec/axis-native.spec.js Show resolved Hide resolved
test/spec/axis-native.spec.js Show resolved Hide resolved
test/spec/axis-native.spec.js Show resolved Hide resolved
test/spec/string-functions-native.spec.js Outdated Show resolved Hide resolved
test/spec/string-functions-native.spec.js Outdated Show resolved Hide resolved
test/spec/string-functions-native.spec.js Outdated Show resolved Hide resolved
test/spec/string-functions-native.spec.js Outdated Show resolved Hide resolved
test/spec/string-functions-native.spec.js Outdated Show resolved Hide resolved
@MartijnR
Copy link
Member Author

MartijnR commented Aug 1, 2019

Sorry @vimemo! I forgot to click 'Submit Review'. Thankfully they were saved...

console.error( 'Could not parse JSON from', curValue );
}

return new g.win.XPathJS.customXPathFunction.type.StringType( status );
Copy link
Member Author

Choose a reason for hiding this comment

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

That looks good. Feel free to change more if e.g. XPathJS.customXPathFunction.type.StringType is an awkward solution in your library. Will you have some documentation on how to add custom functions in your library?

} );
} );


Copy link
Member Author

@MartijnR MartijnR Aug 22, 2019

Choose a reason for hiding this comment

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

Unfortunately, I don't think we can do asynchronous functions in XPath. I am also not very enthusiastic about adding a large library to do this synchronously, so I'm wondering if we should just forget about supporting digest(). It's quite an obscure function.

We do include a library in enketo-express called node-forge to encrypt submissions, which if used in odk-xpath would not increase the size (if the versions are in sync?) in Enketo Express. Not sure if that would support synchronous digest generation.

expect( result.stringValue ).to.have.length( 36 );

result = g.doc.evaluate( 'uuid(6)', g.doc, null, g.win.XPathResult.STRING_TYPE );
expect( result.stringValue ).to.have.length( 6 );
Copy link
Member Author

Choose a reason for hiding this comment

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

There is no particular format requirement, so this should be good! Fyi, this is the ODK Collect code: https://github.com/opendatakit/javarosa/blob/59611cc0755dfbaf6631866ff15d6a9a516df704/src/main/java/org/javarosa/core/util/PropertyUtils.java#L54

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants