3 require_once ("../Spyc.php");
5 class IndentTest extends PHPUnit_Framework_TestCase {
9 protected function setUp() {
10 $this->Y = Spyc::YAMLLoad("indent_1.yaml");
13 public function testIndent_1() {
14 $this->assertEquals (array ('child_1' => 2, 'child_2' => 0, 'child_3' => 1), $this->Y['root']);
17 public function testIndent_2() {
18 $this->assertEquals (array ('child_1' => 1, 'child_2' => 2), $this->Y['root2']);
21 public function testIndent_3() {
22 $this->assertEquals (array (array ('resolutions' => array (1024 => 768, 1920 => 1200), 'producer' => 'Nec')), $this->Y['display']);
25 public function testIndent_4() {
26 $this->assertEquals (array (
27 array ('resolutions' => array (1024 => 768)),
28 array ('resolutions' => array (1920 => 1200)),
29 ), $this->Y['displays']);
32 public function testIndent_5() {
33 $this->assertEquals (array (array (
36 'headsets_affected' => array (
42 'switch_function' => array (
45 )), $this->Y['nested_hashes_and_seqs']);
48 public function testIndent_6() {
49 $this->assertEquals (array (
51 array ('a' => 'b', 'a1' => 'b1'),
54 ), $this->Y['easier_nest']);
57 public function testIndent_space() {
58 $this->assertEquals ("By four\n spaces", $this->Y['one_space']);
61 public function testListAndComment() {
62 $this->assertEquals (array ('one', 'two', 'three'), $this->Y['list_and_comment']);
65 public function testAnchorAndAlias() {
66 $this->assertEquals (array ('database' => 'rails_dev', 'adapter' => 'mysql', 'host' => 'localhost'), $this->Y['development']);
67 $this->assertEquals (array (1 => 'abc'), $this->Y['zzz']);