DDeepin Developerfeat: Init commit
33daf502创建于 2022年10月11日历史提交
#!/usr/bin/perl

use strict;
use File::Spec::Functions ':ALL';

use lib 't/lib';
use PPI::Test::pragmas;
use PPI;

# Execute the tests
use Test::More tests => 5 + ($ENV{AUTHOR_TESTING} ? 1 : 0);

use lib 't/lib';
use Helper 'check_with';

run();

sub run {
	check_with "(1)", sub {
		my $qr = $_->find_first( 'Token::Structure' );
		ok $qr, 'found qr token';
		is $qr->snext_sibling,     "", "non-semicolon tokens shortcut to empty strong for significant siblings";
		is $qr->sprevious_sibling, "", "non-semicolon tokens shortcut to empty strong for significant siblings";
	};
	check_with "(", sub {
		my $tokens = $_->find( 'Token::Structure' );
		ok $tokens->[0], 'found qr token';
		is $tokens->[0]->next_token, '',
		  "empty string is returned as next token for an unclosed structure without children";
	};
}

1;