1#!/usr/bin/perl -w 2 3# Copyright (c) 2018, cPanel, LLC. 4# All rights reserved. 5# http://cpanel.net 6# 7# This is free software; you can redistribute it and/or modify it under the 8# same terms as Perl itself. See L<perlartistic>. 9 10use strict; 11use warnings; 12 13use Test::More; 14 15use XString (); 16 17use B (); 18 19my @strings = ( 20 q[OneWord], 21 q[with space], 22 q[using-dash], 23 q['some"quotes], 24 q['abcd'], 25 q["abcd"], 26 qq[new\nlines\n], 27 qq[end\0character], 28 qq[beep\007], 29 map { chr } 0..128 30); 31 32{ 33 #note "testing cstring"; 34 foreach my $str ( @strings ) { 35 is B::cstring( $str ), XString::cstring( $str ); 36 } 37} 38 39{ 40 #note "testing perlstring"; 41 foreach my $str ( @strings ) { 42 is B::perlstring( $str ), XString::perlstring( $str ); 43 } 44} 45 46 47done_testing(); 48