<commit_before><?xml version="1.0" ?>
<job id="GetCPUInfo">
<script language="VBScript" src="../stdlib.vbs" />
<script language="VBScript" src="../unittest.vbs" />
<script language="VBScript"><![CDATA[

Option Explicit

UnitTest_Description "ListBuffer test in stdlib.vbs."

Dim listBuf

Sub SetUp
  Set listBuf = New ListBuffer
End Sub
UnitTest_SetUp "SetUp"

Sub TestListBuffer_Count
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing

  AssertEqual 3, listBuf.Count
End Sub
UnitTest_TestCase "TestListBuffer_Count"

Sub TestListBuffer_CountEmpty
  AssertEqual 0, listBuf.Count
End Sub
UnitTest_TestCase "TestListBuffer_CountEmpty"

Sub TestListBuffer_GetItem
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing

  AssertEqual "foo", listBuf(0)
  AssertEqual "bar", listBuf(1)
  AssertSame Nothing, listBuf(2)
End Sub
UnitTest_TestCase "TestListBuffer_GetItem"

Sub TestListBuffer_LetSetItem
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing<commit_msg>*** empty log message ***<commit_after><?xml version="1.0" ?>
<job id="GetCPUInfo">
<script language="VBScript" src="../stdlib.vbs" />
<script language="VBScript" src="../unittest.vbs" />
<script language="VBScript"><![CDATA[

Option Explicit

UnitTest_Description "ListBuffer test in stdlib.vbs."

Dim listBuf

Sub SetUp
  Set listBuf = New ListBuffer
End Sub
UnitTest_SetUp "SetUp"

Sub TestListBuffer_Count
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing

  AssertEqual 3, listBuf.Count
End Sub
UnitTest_TestCase "TestListBuffer_Count"

Sub TestListBuffer_CountEmpty
  AssertEqual 0, listBuf.Count
End Sub
UnitTest_TestCase "TestListBuffer_CountEmpty"

Sub TestListBuffer_GetItem
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing

  AssertEqual "foo", listBuf(0)
  AssertEqual "bar", listBuf(1)
  AssertSame Nothing, listBuf(2)
End Sub
UnitTest_TestCase "TestListBuffer_GetItem"

Sub TestListBuffer_GetItemOutOfRange
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing

  Dim errnum
  On Error Resume Next
  listBuf(3)
  errnum = Err.Number: Err.Clear
  On Error GoTo 0

  AssertEqual 9, errnum
End Sub
UnitTest_TestCase "TestListBuffer_GetItemOutOfRange"

Sub TestListBuffer_LetSetItem
  listBuf.Add "foo"
  listBuf.Add "bar"
  listBuf.Add Nothing
{'fraction_non_alphanumeric': 0.09934065934065935, 'fraction_numerical': 0.0074725274725274725, 'mean_word_length': 5.2699724517906334, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 2, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '1859875', 'n_tokens_mistral': 795, 'n_tokens_neox': 786, 'n_words': 200}