<commit_before><?php

namespace PhpTabsTest\Renderer;

use Exception;
use PHPUnit_Framework_TestCase;
use PhpTabs\PhpTabs;
use PhpTabs\Music\Track;

/**
 * Tests the options stack of vextab renderer
 */
class VexTabOptionsTest extends PHPUnit_Framework_TestCase
{
  public function setUp()
  {
    $this->filename  = 'testSimpleTab.gp3';
    $this->tablature = new PhpTabs(PHPTABS_TEST_BASEDIR . '/samples/' . $this->filename);
  }

  /**
   * Tests for getOption() method
   */
  public function testGetOption()
  {
    // Available options
    // This test includes boolean to string transformation
    $options = [
      // Renderer options
      'measures_per_stave'  => 1,

      // Global options
      'space'               => 16,        # An integer
      'scale'               => 0.8,       # A float or an integer
      'stave-distance'      => 20,        # An integer
      'width'               => 500,       # An integer, in pixel

      'font-size'           => 12,        # An integer
      'font-face'           => 'times',   # A string
      'font-style'          => 'italic',  # A string

      'tab-stems'           => true,      # A boolean, default: false
      'tab-stem-direction'  => 'down',    # A string up|down, default: up
      'player'              => false,     # A boolean, default: false

      // Tabstaves options
      'notation'            => true,       # A boolean, default: false
      'tablature'           => true,       # A boolean, default: true
    ];

    $renderer = $this->tablature
      ->getRenderer('vextab')
      ->setOptions($options);

    # Check values
    foreach ($options as $name => $value) {
      if ($value === true) {
//        $value = 'true';
      } elseif ($value === false) {
//        $value = 'false';
      }

      $this->assertEquals(
        $value,
        $renderer->getOption($name),
        sprintf(
          "Name: %s, given: %s, expected: %s", 
          $name,
          $renderer->getOption($name),
          $value
        )
      );
    }
  }

  /**<commit_msg>[Test] Remove dead code from VexTab tests<commit_after><?php

namespace PhpTabsTest\Renderer;

use Exception;
use PHPUnit_Framework_TestCase;
use PhpTabs\PhpTabs;

/**
 * Tests the options stack of vextab renderer
 */
class VexTabOptionsTest extends PHPUnit_Framework_TestCase
{
  public function setUp()
  {
    $this->filename  = 'testSimpleTab.gp3';
    $this->tablature = new PhpTabs(PHPTABS_TEST_BASEDIR . '/samples/' . $this->filename);
  }

  /**
   * Tests for getOption() method
   */
  public function testGetOption()
  {
    // Available options
    // This test includes boolean to string transformation
    $options = [
      // Renderer options
      'measures_per_stave'  => 1,

      // Global options
      'space'               => 16,        # An integer
      'scale'               => 0.8,       # A float or an integer
      'stave-distance'      => 20,        # An integer
      'width'               => 500,       # An integer, in pixel

      'font-size'           => 12,        # An integer
      'font-face'           => 'times',   # A string
      'font-style'          => 'italic',  # A string

      'tab-stems'           => true,      # A boolean, default: false
      'tab-stem-direction'  => 'down',    # A string up|down, default: up
      'player'              => false,     # A boolean, default: false

      // Tabstaves options
      'notation'            => true,       # A boolean, default: false
      'tablature'           => true,       # A boolean, default: true
    ];

    $renderer = $this->tablature
      ->getRenderer('vextab')
      ->setOptions($options);

    # Check values
    foreach ($options as $name => $value) {

      $this->assertEquals(
        $value,
        $renderer->getOption($name),
        sprintf(
          "Name: %s, given: %s, expected: %s", 
          $name,
          $renderer->getOption($name),
          $value
        )
      );
    }
  }

  /**
{'fraction_non_alphanumeric': 0.13163856028190285, 'fraction_numerical': 0.006544173168890007, 'mean_word_length': 1.7501730103806228, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '123075', 'n_tokens_mistral': 1224, 'n_tokens_neox': 1189, 'n_words': 304}