<commit_before>package org.moe.parser

import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter

import org.moe.runtime._
import org.moe.interpreter._
import org.moe.ast._
import org.moe.parser._

class PackageDefinitionTestSuite extends FunSuite with BeforeAndAfter with ParserTestUtils {

  test("... a basic package block") {
    val result = interpretCode("""
      package foo::bar {
      }
    """)
    result match {
      case _: MoeObject => assert(true) // stub
      case _ => assert(false)
    }
  }<commit_msg>add some tests<commit_after>package org.moe.parser

import org.scalatest.FunSuite
import org.scalatest.BeforeAndAfter

import org.moe.runtime._
import org.moe.interpreter._
import org.moe.ast._
import org.moe.parser._

class PackageDefinitionTestSuite extends FunSuite with BeforeAndAfter with ParserTestUtils {

  test("... a basic package block") {
    val result = interpretCode("package Foo {}")
    assert(result.asInstanceOf[MoePackage].getName === "Foo")
  }

  test("... simple package scoping") {
    val result = interpretCode("package Foo { sub bar {'BAR'} } Foo::bar()")
    assert(result.unboxToString.get === "BAR")
  }

  test("... nested package scoping") {
    val result = interpretCode("package Foo { package Bar { sub baz {'BAZ'} } } Foo::Bar::baz()")
    assert(result.unboxToString.get === "BAZ")
  }

  test("... complex package scoping") {
    val result = interpretCode("package Foo { package Bar { sub baz {'BAZ'} sub bar {baz()} } } Foo::Bar::bar()")
    assert(result.unboxToString.get === "BAZ")
  }
{'fraction_non_alphanumeric': 0.13901345291479822, 'fraction_numerical': 0.0, 'mean_word_length': 3.7477203647416415, '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': '6959904', 'n_tokens_mistral': 500, 'n_tokens_neox': 484, 'n_words': 124}