mirror of
				https://github.com/robertkrimen/otto
				synced 2025-10-19 19:55:30 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			27 lines
		
	
	
		
			545 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			27 lines
		
	
	
		
			545 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package otto
 | |
| 
 | |
| import (
 | |
|     "testing"
 | |
|     . "github.com/robertkrimen/terst"
 | |
| )
 | |
| 
 | |
| func TestStash(t *testing.T) {
 | |
|     Terst(t)
 | |
| 
 | |
| 	stash := newObjectStash(true)
 | |
| 	IsTrue(stash.canPut("xyzzy"))
 | |
| 
 | |
| 	//stash.define("xyzzy", _defineProperty{
 | |
| 	//    Value: toValue("Nothing happens."),
 | |
| 	//})
 | |
| 	//IsTrue(stash.test("xyzzy"))
 | |
| 	//IsTrue(stash.canPut("xyzzy"))
 | |
| 
 | |
| 	//stash.define("xyzzy", _defineProperty{
 | |
| 	//    Value: toValue("Something else happens."),
 | |
| 	//    Write: propertyAttributeFalse,
 | |
| 	//})
 | |
| 	//IsTrue(stash.test("xyzzy"))
 | |
| 	//IsFalse(stash.canPut("xyzzy"))
 | |
| }
 | 
