<commit_before>package tests;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;

import com.github.sormuras.bach.Command;
import org.junit.jupiter.api.Test;
import tests.util.Print;

class CommandTests {

  @Test
  void withoutArguments() {
    var command = Command.of("name");
    assertEquals("name", command.name());
    var commandLine = command.toString();
    assertEquals("name", commandLine);
    assertEquals(Command.builder("name").build().toString(), commandLine);
  }

  @Test
  void withArguments() {
    var command = Command.builder("name").with(1).with("2", 3, 4).build();
    assertEquals("name", command.name());
    assertEquals("name 1 2 3 4", command.toString());
    assertEquals(Command.of("name", 1, 2, 3, 4).toString(), command.toString());
  }

  @Test
  void toCommandReturnsItself() {
    var expected = Command.of("name");<commit_msg>Use command's hash code method<commit_after>package tests;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertSame;

import com.github.sormuras.bach.Command;
import org.junit.jupiter.api.Test;
import tests.util.Print;

class CommandTests {

  @Test
  void withoutArguments() {
    var command = Command.of("name");
    assertEquals("name", command.name());
    var commandLine = command.toString();
    assertEquals("name", commandLine);
    assertEquals(Command.builder("name").build().toString(), commandLine);
  }

  @Test
  void withArguments() {
    var command = Command.builder("name").with(1).with("2", 3, 4).build();
    assertEquals("name", command.name());
    assertEquals("name 1 2 3 4", command.toString());
    assertEquals(Command.of("name", 1, 2, 3, 4).hashCode(), command.hashCode());
  }

  @Test
  void toCommandReturnsItself() {
    var expected = Command.of("name");
{'fraction_non_alphanumeric': 0.1595124536301007, 'fraction_numerical': 0.012718600953895072, 'mean_word_length': 4.602373887240356, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4215295', 'n_tokens_mistral': 579, 'n_tokens_neox': 551, 'n_words': 121}