Skip to content

Commit

Permalink
Merge pull request #127 from VincentLanglet/addTests
Browse files Browse the repository at this point in the history
🚨 Add tests
  • Loading branch information
VincentLanglet authored Apr 26, 2020
2 parents fae0a11 + 2ee4767 commit 2bc5cd9
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ 1..10 }}
{{ foo.bar }}
{{ (foo) }}
{{ {'a': 'b', 'c': 'd'} }}
{% set a = [1, 2, 4] %}
{{ a|trans }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

namespace TwigCS\Tests\Ruleset\Generic\PunctuationSpacing;

use TwigCS\Ruleset\Generic\PunctuationSpacingSniff;
use TwigCS\Tests\Ruleset\AbstractSniffTest;

/**
* Class PunctuationSpacingTest
*/
class PunctuationSpacingTest extends AbstractSniffTest
{
/**
* @return void
*/
public function testSniff(): void
{
$this->checkSniff(new PunctuationSpacingSniff(), [
[3 => 4],
[3 => 10],
[4 => 4],
[4 => 10],
[4 => 16],
[4 => 22],
[4 => 28],
[5 => 12],
[5 => 16],
[5 => 20],
[5 => 24],
[6 => 6],
[6 => 6],
]);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{{ 1..10 }}
{{ foo.bar }}
{{ ( foo ) }}
{{ { 'a' : 'b' , 'c' : 'd' } }}
{% set a = [ 1 , 2 , 4 ] %}
{{ a | trans }}

0 comments on commit 2bc5cd9

Please sign in to comment.