add tests for #3057 and #2651
add tests for #3057 and #2651

Fixes #3057
Fixes #2651

aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,graydon/rust,graydon/rust,aidancully/rust,aidancully/rust,aidancully/rust