@Test
public void testVariableNameValidation() {

    assertTrue(Script.isValidVariableName("foo"));
    assertTrue(Script.isValidVariableName("foo_bar"));
    assertTrue(Script.isValidVariableName("foo_"));
    assertTrue(Script.isValidVariableName("foo1"));
    assertTrue(Script.isValidVariableName("a"));
    assertTrue(Script.isValidVariableName("a1"));
    // bad
    assertFalse(Script.isValidVariableName("foo.bar"));
    assertFalse(Script.isValidVariableName("foo-bar"));
    assertFalse(Script.isValidVariableName("$foo"));
    assertFalse(Script.isValidVariableName("$foo/bar"));
    assertFalse(Script.isValidVariableName("_foo"));
    assertFalse(Script.isValidVariableName("_foo_"));
    assertFalse(Script.isValidVariableName("0"));
    assertFalse(Script.isValidVariableName("2foo"));
}