Last active
August 29, 2015 13:58
-
-
Save spiegela/9992894 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prop_encode_decode() -> | |
?FORALL(Int, integer(), | |
begin | |
?assertEqual(Int, prop_encode_decode(Int)) | |
end). | |
prop_encode_decode(Int) -> | |
EncInt = base64_vlq:encode(Int), | |
DecIntWrapped = base64_vlq:decode(EncInt), % for my decoder, the value comes back wrapped | |
DecInt = lists:keyfind(value, 1, DecIntWrapped), % in a property list, so we have couple of | |
DecInt. % lines to pull out just the decoded value. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment