<commit_before>package org.approvaltests;

import org.approvaltests.awt.AwtApprovals;
import org.approvaltests.combinations.CombinationApprovals;
import org.approvaltests.machine_specific_tests.TvGuide;
import org.approvaltests.namer.NamedEnvironment;
import org.approvaltests.namer.NamerFactory;
import org.junit.jupiter.api.Test;

import java.awt.*;

public class GettingStartedTest {
    @Test
    void testBasicCall() {
        String objectToBeVerified = "Now is the time for all good coders to come to the aid of their countrypersons";
        // begin-snippet: basic_verified_call
        Approvals.verify(objectToBeVerified);
        // end-snippet
    }

    // begin-snippet: verifying_strings
    @Test
    public void testBuildString() {
        /* Do */
        // create a string with "Approval" and append "Tests" to it
        String s = "Approval";
        s += " Tests";
        /* Verify */
        // Verify the resulting string
        Approvals.verify(s);
    }

    // end-snippet
    // begin-snippet: verifying_objects
    @Test
    public void testObject() {
        /* Do */
        // create an 100 x 200 rectangle with the top corner at (5, 10)
        Rectangle objectUnderTest = new Rectangle(5, 10, 100, 200);
        /* Verify */
        // Verify the rectangle is properly defined
        Approvals.verify(objectUnderTest.toString());
    }

    // end-snippet
    @Test
    public void testObjectWithJson() {
        /* Do */
        // create an 100 x 200 rectangle with the top corner at (5, 10)
        Rectangle objectUnderTest = new Rectangle(5, 10, 100, 200);
        /* Verify */
        // Verify the rectangle is properly defined
        // begin-snippet: verifying_objects_with_json
        JsonApprovals.verifyAsJson(objectUnderTest);
        // end-snippet
    }

    // begin-snippet: verifying_arrays
    @Test
    public void testArray() {
        /* Do */
        // create a String Array and set values in the indexes
        String[] s = new String[2];
        s[0] = "Approval";
        s[1] = "Tests";
        /* Verify */
        // Verify the array
        Approvals.verifyAll("Text", s);
    }
    // end-snippet
    
    @Test
    public void testTvGuide() {
        try (NamedEnvironment namedEnvironment = NamerFactory.asOsSpecificTest()) {
            if (!namedEnvironment.isCurrentEnvironmentValidFor("Windows_10")) {
                return;
            }
        }
        // begin-snippet: verifying_gui
        /* Do */
        // create a TV Guide and select a show for 3pm
        TvGuide tv = new TvGuide();
        tv.selectTime("3pm");
        /* Verify */
        // Verify the TvGuide
        AwtApprovals.verify(tv);
        // end-snippet
    }
    
    @Test
    public void testCombinations() {
        // begin-snippet: verify_combinations
        Integer[] lengths = new Integer[]{4, 5, 10};
        String[] words = new String[]{"Bookkeeper", "applesauce"};
        CombinationApprovals.verifyAllCombinations(
                (i, s) -> s.substring(0, i),
                lengths,
                words);
        // end-snippet
    }
}<commit_msg>a   reformat code<commit_after>package org.approvaltests;

import org.approvaltests.awt.AwtApprovals;
import org.approvaltests.combinations.CombinationApprovals;
import org.approvaltests.machine_specific_tests.TvGuide;
import org.approvaltests.namer.NamedEnvironment;
import org.approvaltests.namer.NamerFactory;
import org.junit.jupiter.api.Test;

import java.awt.*;

public class GettingStartedTest
{
  @Test
  void testBasicCall()
  {
    String objectToBeVerified = "Now is the time for all good coders to come to the aid of their countrypersons";
    // begin-snippet: basic_verified_call
    Approvals.verify(objectToBeVerified);
    // end-snippet
  }
  // begin-snippet: verifying_strings
  @Test
  public void testBuildString()
  {
    /* Do */
    // create a string with "Approval" and append "Tests" to it
    String s = "Approval";
    s += " Tests";
    /* Verify */
    // Verify the resulting string
    Approvals.verify(s);
  }
  // end-snippet
  // begin-snippet: verifying_objects
  @Test
  public void testObject()
  {
    /* Do */
    // create an 100 x 200 rectangle with the top corner at (5, 10)
    Rectangle objectUnderTest = new Rectangle(5, 10, 100, 200);
    /* Verify */
    // Verify the rectangle is properly defined
    Approvals.verify(objectUnderTest.toString());
  }
  // end-snippet
  @Test
  public void testObjectWithJson()
  {
    /* Do */
    // create an 100 x 200 rectangle with the top corner at (5, 10)
    Rectangle objectUnderTest = new Rectangle(5, 10, 100, 200);
    /* Verify */
    // Verify the rectangle is properly defined
    // begin-snippet: verifying_objects_with_json
    JsonApprovals.verifyAsJson(objectUnderTest);
    // end-snippet
  }
  // begin-snippet: verifying_arrays
  @Test
  public void testArray()
  {
    /* Do */
    // create a String Array and set values in the indexes
    String[] s = new String[2];
    s[0] = "Approval";
    s[1] = "Tests";
    /* Verify */
    // Verify the array
    Approvals.verifyAll("Text", s);
  }
  // end-snippet
  @Test
  public void testTvGuide()
  {
    try (NamedEnvironment namedEnvironment = NamerFactory.asOsSpecificTest())
    {
      if (!namedEnvironment.isCurrentEnvironmentValidFor("Windows_10"))
      { return; }
    }
    // begin-snippet: verifying_gui
    /* Do */
    // create a TV Guide and select a show for 3pm
    TvGuide tv = new TvGuide();
    tv.selectTime("3pm");
    /* Verify */
    // Verify the TvGuide
    AwtApprovals.verify(tv);
    // end-snippet
  }
  @Test
  public void testCombinations()
  {
    // begin-snippet: verify_combinations
    Integer[] lengths = new Integer[]{4, 5, 10};
    String[] words = new String[]{"Bookkeeper", "applesauce"};
    CombinationApprovals.verifyAllCombinations((i, s) -> s.substring(0, i), lengths, words);
    // end-snippet
  }
}
{'fraction_non_alphanumeric': 0.11187868576242628, 'fraction_numerical': 0.016175231676495365, 'mean_word_length': 2.3842645381984036, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3753184', 'n_tokens_mistral': 1897, 'n_tokens_neox': 1782, 'n_words': 475}