<commit_before>// Copyright 2009 Google Inc. All Rights Reserved.

package com.google.appinventor.blocklyeditor;

import java.io.IOException;

import com.google.appinventor.common.testutils.TestUtils;

import junit.framework.TestCase;

/**
 * Tests the App Inventor Blockly blocks evaluation of various YAIL code.
 * 
 * TODO(andrew.f.mckinney): More tests needed!
 * 
 * @author <EMAIL> (Andrew.F.McKinney)
 */

public class BlocklyEvalTest extends TestCase {
  
  public static final String testpath = TestUtils.APP_INVENTOR_ROOT_DIR + "/blocklyeditor";

  public void testButtonClick() throws Exception {

    String[] params = { "/usr/local/bin/phantomjs", testpath + "/tests/com/google/appinventor/blocklyeditor/buttonClickTest.js" };
    String result = "";

    try {
      result = CodeBlocksProcessHelper.exec(params, true).trim();
    } catch (IOException e) {
      e.printStackTrace();
    }

    assertEquals("true", result.toString());
  }
  
  public void testIfThenBlock() throws Exception {

    String[] params = { "/usr/local/bin/phantomjs", testpath + "/tests/com/google/appinventor/blocklyeditor/ifThenBlockTest.js" };
    String result = "";

    try {
      result = CodeBlocksProcessHelper.exec(params, true).trim();
    } catch (IOException e) {
      e.printStackTrace();
    }

    assertEquals("true", result.toString());
  }
}<commit_msg>Remove absolute path name from calls to phantomjs.<commit_after>// Copyright 2009 Google Inc. All Rights Reserved.

package com.google.appinventor.blocklyeditor;

import java.io.IOException;

import com.google.appinventor.common.testutils.TestUtils;

import junit.framework.TestCase;

/**
 * Tests the App Inventor Blockly blocks evaluation of various YAIL code.
 * 
 * TODO(andrew.f.mckinney): More tests needed!
 * 
 * @author andrew.f.m<EMAIL> (Andrew.F.McKinney)
 */

public class BlocklyEvalTest extends TestCase {
  
  public static final String testpath = TestUtils.APP_INVENTOR_ROOT_DIR + "/blocklyeditor";

  public void testButtonClick() throws Exception {

    String[] params = { "phantomjs", testpath + "/tests/com/google/appinventor/blocklyeditor/buttonClickTest.js" };
    String result = "";

    try {
      result = CodeBlocksProcessHelper.exec(params, true).trim();
    } catch (IOException e) {
      e.printStackTrace();
    }

    assertEquals("true", result.toString());
  }
  
  public void testIfThenBlock() throws Exception {

    String[] params = { "phantomjs", testpath + "/tests/com/google/appinventor/blocklyeditor/ifThenBlockTest.js" };
    String result = "";

    try {
      result = CodeBlocksProcessHelper.exec(params, true).trim();
    } catch (IOException e) {
      e.printStackTrace();
    }

    assertEquals("true", result.toString());
  }
}
{'fraction_non_alphanumeric': 0.12468193384223919, 'fraction_numerical': 0.0029080334423845873, 'mean_word_length': 3.7204116638078903, 'pattern_counts': {'":': 0, '<': 5, '<?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': '2774457', 'n_tokens_mistral': 849, 'n_tokens_neox': 813, 'n_words': 187}