adding tests
merging in upstream changes