<commit_before>// Copyright 2017 The go-vm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import "github.com/go-vm/vmware/fusion"

const vmwarevmPath = "/Volumes/APFS/VirtualMachine/macOS-10.12.vmwarevm/macOS-10.12.vmx"

func main() {
	if err := fusion.Start(vmwarevmPath, false); err != nil {
		panic(err.Error())
	}

	if err := fusion.Stop(vmwarevmPath, true); err != nil {
		panic(err.Error())
	}
}<commit_msg>cmd/vmrun: add snapshot test<commit_after>// Copyright 2017 The go-vm Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package main

import (
	"log"

	"github.com/go-vm/vmware/fusion"
)

const vmwarevmPath = "/Volumes/APFS/VirtualMachine/macOS-10.12.vmwarevm/macOS-10.12.vmx"

func main() {
	if err := fusion.Start(vmwarevmPath, false); err != nil {
		panic(err.Error())
	}

	if err := fusion.Stop(vmwarevmPath, true); err != nil {
		panic(err.Error())
	}

	list, num, err := fusion.ListSnapshots(vmwarevmPath)
	if err != nil {
		panic(err.Error())
	}
	log.Printf("list: %T => %+v\n", list, list)
	log.Printf("num: %T => %+v\n", num, num)

	if err := fusion.Snapshot(vmwarevmPath, "testSnapshot"); err != nil {
		panic(err.Error())
	}

	list2, num2, err := fusion.ListSnapshots(vmwarevmPath)
	if err != nil {
		panic(err.Error())
	}
	log.Printf("list: %T => %+v\n", list2, list2)
	log.Printf("num: %T => %+v\n", num2, num2)

	if err := fusion.DeleteSnapshot(vmwarevmPath, "testSnapshot", true); err != nil {
		panic(err.Error())
	}

	list3, num3, err := fusion.ListSnapshots(vmwarevmPath)
	if err != nil {
		panic(err.Error())
	}
	log.Printf("list: %T => %+v\n", list3, list3)
	log.Printf("num: %T => %+v\n", num3, num3)
}
{'fraction_non_alphanumeric': 0.1738891936368623, 'fraction_numerical': 0.019747668678003292, 'mean_word_length': 3.851063829787234, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '3050968', 'n_tokens_mistral': 728, 'n_tokens_neox': 697, 'n_words': 175}