Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd hash commands #38
Conversation
|
Most excellent that you added tests. I presume this passes |
|
test suite passes on my end. not sure what's going on. I'll try to dig into travis later. |
|
Test file: /usr/lib64/R/library/RcppRedis/tests/runit.hashTests.R I have a more recent distro at home. I'll give it a shot later. |
|
Ok, with a bid of prodding (needed to install Look closely at I am seeing a little bit of noise in your tests 7 and 8 but they end up with a pass. |
|
yes, I'm setting uncommitted locally to get the suite to run: |
|
I have a super-old helper script I use to run individual scripts. Installed as #!/bin/sh
set -u
set -e
progname=`basename $0`
options='p:ah?'
usage_and_exit()
{
echo ""
echo "Usage: $progname [-p package[,package2,..]] [-?|-h]"
echo " Run unit test script for R package"
echo ""
echo "Options:"
echo " -p package[,package2,..]] load additional package(s)"
echo " -h show this help"
echo " -a run with 'export RunAllRcppTests=yes'"
echo ""
echo "The RUnit and inline packages are automatically loaded."
echo ""
exit 0
}
while getopts "$options" i
do
case "$i" in
p)
pkg=",$OPTARG"
shift
shift
;;
a)
export RunAllRcppTests="yes"
shift
;;
h|?)
usage_and_exit
;;
esac
done
if [ ! -f $1 ]; then
echo "Error: No file '$1' found"
exit 1
fi
file=`pwd`/$1
#r -i -t -linline,RUnit${pkg} -e"cppfunction <- function(...) cxxfunction(..., plugin=\"Rcpp\"); runTestFile(\"$file\")"
r -t -lRUnit${pkg} -e"runTestFile(\"$file\")"
|
|
This comes back in a different order for me: R> res <- redis$hkeys(hashname)
R> res
[1] "cat" "hat"
R> checkEquals(res, c(xname,yname))
Error in checkEquals(res, c(xname, yname)) : 2 string mismatchesso I suggest something like testing this against R> sort(match(res, c(xname,yname)))
[1] 1 2Or maybe Similarly here: R> res <- redis$hgetall(hashname)
R> res
$cat
[1] -0.6907126 -0.6411130 0.7017554 0.3448584 0.4657207 -0.0544486 -0.4507790 -0.4544461 1.6455678 0.6807456
$hat
[1] -0.1404888 -0.4863224 -1.2442523 0.0332487 -0.6447859 -0.4333763 1.8892861 -0.9328419 -0.3047753 -0.1825650
R> checkEquals(res, structure(list(xdata,ydata),names=c(xname,yname)))
Error in checkEquals(res, structure(list(xdata, ydata), names = c(xname, :
Names: 2 string mismatches
Component 1: Mean relative difference: 1.64501
Component 2: Mean relative difference: 1.60271
R> |
|
aha. Ok. I'll change the test and re-submit. Likely Thursday, I'll be tied up tomorrow. thx for digging into this. |
|
Make it 'tests' -- I'd change 7 and 8. (And in hindsight, we were crazy there. We do not need one function per testing equation. Could all be one or two. But now that it is written...) I'll also clean up the test runner in |
|
GitHub keeps reminding us that
is possible so I just did that. It's a minimal change -- just glance at it and nod or yell nopes. |
|
looks good to me. and thanks. |
|
I pulled in your changes locally. passes all tests. |
31c6ef1
into
eddelbuettel:master
add other basic hash functions
closes #37