+
+my $bad_rfc2307_1 = '{SCRYPT}notavalidscryptstringaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+my $bad_rfc2307_2 = '{SCRYPT}c2NyeXB0AAwAAAAIAAAAAZ/+bp8gWcTZgEC7YQZeLLyxFeKRRdDkwbaGeFC0NkdUraaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa';
+
+throws_ok { Authen::Passphrase::Scrypt->new }
+ qr/passphrase not set/, 'new without passphrase';
+throws_ok { Authen::Passphrase::Scrypt->from_rfc2307('bad') }
+ qr/Invalid Scrypt RFC2307/, 'from_rfc2307 with bad string';
+throws_ok { Authen::Passphrase::Scrypt->from_rfc2307($bad_rfc2307_1) }
+ qr/Invalid Scrypt RFC2307: should start/, 'from_rfc2307 with another bad string';
+throws_ok { Authen::Passphrase::Scrypt->from_rfc2307($bad_rfc2307_2) }
+ qr/Invalid Scrypt RFC2307: bad checksum/, 'from_rfc2307 with yet another rfc2307';
+throws_ok { Authen::Passphrase::Scrypt->from_crypt('') }
+ qr/does not support crypt strings/, 'from_crypt';
+throws_ok { $y->as_crypt }
+ qr/does not support crypt strings/, 'as_crypt';
+throws_ok { Authen::Passphrase::Scrypt->new(passphrase => 'xkcd', r => (1 << 30), p => (1 << 30)) }
+ qr/Error in crypto_scrypt/, 'new with huge r and p';